From 544100da719843438372c6e30739bf9b5d3ebb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 18 Aug 2021 04:54:45 +0300 Subject: Init Basically functional. --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8917d8e --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +CC?=gcc +RM:=rm -rf + +SRC_DIR:=src +OBJ_DIR:=obj +INC_DIRS=$(addprefix -iquote,include) + +PARCINI_SOURCES:=$(wildcard $(SRC_DIR)/*.c) +PARCINI_OBJECTS:=$(PARCINI_SOURCES:%.c=$(OBJ_DIR)/%.o) +BUILD_DIR:=build + +test: CFLAGS := -std=c99 -O0 -g -Wall -DDEBUG +test: $(BUILD_DIR) tests/parcini + +tests/%: $(OBJ_DIR)/src/tests/%.o $(OBJ_DIR)/src/%.o $(PARCINI_OBJECTS) + $(CC) $(LDFLAGS) -o $(BUILD_DIR)/$@ $^ + $(BUILD_DIR)/$@ + +$(OBJ_DIR)/%.o: %.c + $(CC) -c $(CFLAGS) $(INC_DIRS) -o $@ $< + +$(BUILD_DIR): + mkdir -p $(BUILD_DIR)/tests + mkdir -p $(OBJ_DIR)/src/tests + +clean: + $(RM) $(OBJ_DIR) + $(RM) $(BUILD_DIR) + +.PHONY: clean test + +.PRECIOUS: $(OBJ_DIR)/tests/%.o $(OBJ_DIR)/%.o -- cgit v1.2.3