diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-21 15:58:12 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-21 15:58:12 +0200 |
| commit | ca5071168115e5cd272978e13ddb9fbb1365afbc (patch) | |
| tree | 121bc50df693b70771a17d9b364da4d3896c9344 /Makefile | |
| parent | d2fac61b27d827dc81a6ed867ec92dfad14a3385 (diff) | |
| download | libasm_test-ca5071168115e5cd272978e13ddb9fbb1365afbc.tar.gz libasm_test-ca5071168115e5cd272978e13ddb9fbb1365afbc.tar.bz2 libasm_test-ca5071168115e5cd272978e13ddb9fbb1365afbc.zip | |
WIP: Linux compatibility
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 65 |
1 files changed, 36 insertions, 29 deletions
@@ -6,69 +6,74 @@ # By: cacharle <marvin@42.fr> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/02/08 03:06:59 by cacharle #+# #+# # -# Updated: 2020/04/12 20:12:48 by charles ### ########.fr # +# Updated: 2020/10/21 15:57:34 by charles ### ########.fr # # # # **************************************************************************** # -RM = rm -f -UNAME = $(shell uname) - -ifeq ($(UNAME), Linux) - PYTHON = python3.7 -else - PYTHON = python3 -endif +LIBASM_PATH = ../pg -LIBASM_PATH = ../libasm +RM = rm -f +PYTHON = python3 CC = gcc -CCFLAGS = -I. -Wall -Wextra +CCFLAGS = -I. -Wall -Wextra -Wno-nonnull LDFLAGS = -L$(LIBASM_PATH) -lasm NAME = runtest SRC = main.c \ helper.c \ - helper_list.c \ test/ft_strlen_test.c \ test/ft_strcpy_test.c \ test/ft_strcmp_test.c \ test/ft_write_test.c \ test/ft_read_test.c \ test/ft_strdup_test.c \ - test/ft_atoi_base_test.c \ - test/ft_list_size_test.c \ - test/ft_list_push_front_test.c \ - test/ft_list_sort_test.c \ - test/ft_list_remove_if_test.c \ - functions_reference/ref_ft_atoi_base.c \ - functions_reference/ref_ft_list_size.c \ - functions_reference/ref_ft_list_push_front.c \ - functions_reference/ref_ft_list_sort.c \ - functions_reference/ref_ft_list_remove_if.c + +SRCBONUS = helper_list.c \ + test/ft_atoi_base_test.c \ + test/ft_list_size_test.c \ + test/ft_list_push_front_test.c \ + test/ft_list_sort_test.c \ + test/ft_list_remove_if_test.c \ + functions_reference/ref_ft_atoi_base.c \ + functions_reference/ref_ft_list_size.c \ + functions_reference/ref_ft_list_push_front.c \ + functions_reference/ref_ft_list_sort.c \ + functions_reference/ref_ft_list_remove_if.c + +ifeq ($(LIBASM_TEST_BONUS),yes) + SRC += $(SRCBONUS) + CCFLAGS += -D LIBASM_TEST_BONUS +endif + +# CCFLAGS += -fPIE -fPIC OBJ = $(SRC:.c=.o) +OBJBONUS = $(SRCBONUS:.c=.o) +OBJBONUS += $(OBJ) + run: pretty -runbonus: prettybonus +# runbonus: prettybonus -prettybonus: allbonus pretty +# prettybonus: allbonus pretty pretty: all ./$(NAME) 2> /dev/null | $(PYTHON) prettier.py -run_rawbonus: allbonus run_raw +# run_rawbonus: allbonus run_raw run_raw: all ./$(NAME) 2> /dev/null -run_debugbonus: allbonus run_debug +# run_debugbonus: allbonus run_debug run_debug: all ./$(NAME) all: $(NAME) -allbonus: CCFLAGS += -D LIBASM_TEST_BONUS -allbonus: all +# allbonus: +# allbonus: all $(NAME): libasm_all $(OBJ) - $(CC) -o $@ $(OBJ) $(LDFLAGS) + $(CC) -fPIE -fPIC -o $@ $(OBJ) $(LDFLAGS) %.o: %.c $(CC) $(CCFLAGS) -c -o $@ $< @@ -87,3 +92,5 @@ libasm_all: libasm_fclean: make -C $(LIBASM_PATH) fclean + +.PHONY: run pretty run_raw run_debug all clean fclean re libasm_all libasm_fclean |
