From 9f6e8875fda676b76e0f644375f31c54c5aae992 Mon Sep 17 00:00:00 2001 From: PERDRIAU nelson Date: Tue, 14 Apr 2020 17:55:55 +0200 Subject: [PATCH] =?UTF-8?q?:=20Ajout=20d'une=20premi=C3=A8re=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Makefile b/Makefile index e69de29..a365c52 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,19 @@ +TARGET ?= dazibao +SRC_DIRS ?= ./src/* +CC := gcc +CFLAGS= -O2 -Wall -lssl -lcrypto +SRCS := $(shell find $(SRC_DIRS) -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) $(CFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS) + +.PHONY: clean +clean: + $(RM) $(TARGET) $(OBJS) $(DEPS) + +-include $(DEPS)