move files around

This commit is contained in:
hsv2 2022-10-01 15:05:04 +02:00
parent 73f49eb95f
commit 9cd4af7fe6
27 changed files with 53 additions and 35 deletions

View File

@ -1,33 +1,54 @@
NAME = push_swap
CFLAGS = -Ofast -march=native -pipe -Wall -Wextra -Wpedantic
CPPFLAGS = -I$(LFTDIR) -Iinclude -MMD -MP
LDFLAGS = -L$(LFTDIR) -L$(DIST_DIR)
CFLAGS = -Ofast \
-march=native \
-pipe \
-Wall \
-Wextra \
-Wpedantic
CPPFLAGS = -I$(LFTDIR) \
-Iinclude \
-MMD \
-MP
LDFLAGS = -L$(LFTDIR) \
-L$(DIST_DIR) \
-lpushswap \
-lftstack \
-lftarray \
-lft
SANITIZE = -fsanitize=address,undefined
DEBUG = -O0 -g3 -ggdb
DEBUG = -O0 \
-g3 \
-ggdb
DIST_DIR = dist/
LFTDIR = libft/
LFT = $(addprefix $(LFTDIR), libft.a)
ARRAY_SRC = src/ft_array_func.c \
src/ft_array_func_extra.c \
src/ft_array_life.c
ARRAY_SRC = $(addprefix src/array/, \
ft_array_life.c \
func.c \
func_extra.c \
)
LARRAY = $(addprefix $(DIST_DIR), libftarray.a)
STACK_SRC = src/stack_attr.c \
src/stack_common_ops.c \
src/stack_extra_ops.c \
src/stack_life.c \
src/int_stack.c
STACK_SRC = $(addprefix src/stack/, \
attr.c \
op_common.c \
op_extra.c \
stack_int.c \
stack_life.c \
)
LSTACK = $(addprefix $(DIST_DIR), libftstack.a)
PUSHWAP_SRC = src/push_swap.c \
src/push_swap_ctx.c \
src/push_swap_exec.c \
src/push_swap_info.c \
src/push_swap_info_item.c \
src/push_swap_info_update.c \
src/push_swap_op.c \
src/push_swap_sort.c \
src/rotate.c \
src/reverse_rotate.c
PUSHWAP_SRC = $(addprefix src/pushswap/, \
exec.c \
op.c \
op_push_swap.c \
op_rot.c \
op_rrot.c \
push_swap_ctx.c \
push_swap_info.c \
push_swap_info_item.c \
push_swap_info_update.c \
sort.c \
)
LPUSHSWAP = $(addprefix $(DIST_DIR), libpushswap.a)
TEST_STACK_SRC = test/stack.c
@ -81,15 +102,15 @@ $(LPUSHSWAP): $(PUSHWAP_SRC:.c=.o)
$(TEST_STACK): $(TEST_STACK_SRC:.c=.o) $(LSTACK) $(LARRAY) $(LFT)
mkdir -p $(DIST_DIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ $(TEST_PUSHSWAP_SRC:.c=.o) $(CFLAGS) $(LDFLAGS) $(LDLIBS)
$(TEST_PUSHSWAP): $(TEST_PUSHSWAP_SRC:.c=.o) $(LPUSHSWAP) $(LSTACK) $(LARRAY) $(LFT)
mkdir -p $(DIST_DIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
$(CC) -o $@ $(TEST_PUSHSWAP_SRC:.c=.o) $(CFLAGS) $(LDFLAGS) $(LDLIBS)
$(TUI_MONITOR): $(TUI_MONITOR_SRC:.c=.o) $(LPUSHSWAP) $(LSTACK) $(LARRAY) $(LFT)
mkdir -p $(DIST_DIR)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(shell pkg-config --libs ncurses)
$(CC) -o $@ $(TUI_MONITOR_SRC:.c=.o) $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(shell pkg-config --libs ncurses)
.PHONY: all clean debug fclean test sanitize;
-include $(DEPENDENCIES)

View File

@ -1,6 +1,6 @@
#include <curses.h>
#include <stdio.h>
#include "../src/push_swap_ctx.h"
#include "../src/pushswap/push_swap_ctx.h"
#include "tui.h"
typedef struct {

View File

@ -2,8 +2,6 @@
#include "libft.h"
#include "push_swap.h"
#include <ncurses.h>
void plot_graph(WINDOW *win, t_stack_view s, int max, int min)
{
const int offset = 2;

View File

@ -1,9 +1,9 @@
#ifndef TUI_H
#define TUI_H
#include <push_swap.h>
#include <curses.h>
typedef struct _win_st WINDOW;
#include <push_swap.h>
static inline float lerp(float a, float b, float t)
{

View File

@ -18,7 +18,6 @@
#include <libft.h>
#include "ft_array_data.h"
#include "ft_array_item.h"
t_array *arr_rev(t_array *a, size_t start, size_t end)
{

View File

@ -10,10 +10,11 @@
/* */
/* ************************************************************************** */
#include "push_swap_info.h"
#include "ft_stack.h"
#include <stdlib.h>
#include <ft_stack.h>
t_stack_info *stack_info_new(const t_stack *s)
{
t_stack_info *const info = malloc(sizeof (t_stack_info));

View File

@ -10,7 +10,6 @@
/* */
/* ************************************************************************** */
#include "ft_array.h"
#include <ft_stack.h>
#include <limits.h>

View File

@ -2,7 +2,7 @@
#include <ft_stack.h>
#include "../src/stack_data.h"
#include "../src/stack/stack_data.h"
//#define printf(...) (void)0
//#define putchar(...) (void)0