From 1295a91f42dfd238a6cd2d61ac4ad17f7655def7 Mon Sep 17 00:00:00 2001 From: n07070 Date: Tue, 31 Mar 2020 22:35:56 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20premi=C3=A8re=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..edf58ae --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +TARGET ?= dazibao +SRC_DIRS ?= ./src/* +CC := gcc -Wall +SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) +OBJS := $(addsuffix .o,$(basename $(SRCS))) +DEPS := $(OBJS:.o=.d) + +INC_DIRS := $(shell find $(SRC_DIRS) -type d) +INC_FLAGS := $(addprefix -I,$(INC_DIRS)) + +$(TARGET): $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS) + +.PHONY: clean +clean: + $(RM) $(TARGET) $(OBJS) $(DEPS) + +-include $(DEPS)