From c05b4aa2119aa6ec91dceee5157ab61b7d977049 Mon Sep 17 00:00:00 2001 From: Xawirses Date: Tue, 19 Jan 2016 14:34:52 +0100 Subject: [PATCH] Update MakeFile --- Makefile | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e819137..1ff004f 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,21 @@ -CC = gcc +CC=gcc LIBS = -lm -CCFLAGS = -Wall -ggdb +CCFLAGS=-Wall -W -ggdb -std=c99 -pedantic -I./header -I/usr/include +LDFLAGS= -OBJ = analyseur_lexical.o util.o +SRC=$(wildcard src/*.c) +OBJ=$(SRC:.c=.o) -all: test_yylex +EXEC=compilateur-l + +all: $(EXEC) + +$(EXEC): $(OBJ) + $(CC) -o $(EXEC) $^ $(LDFLAGS) + +%.o: %.c + $(CC) -o $@ -c $< $(CCFLAGS) test_yylex: test_yylex.c $(OBJ) $(CC) $(CCFLAGS) -o test_yylex test_yylex.c $(OBJ) @@ -16,5 +26,20 @@ analyseur_lexical.o: analyseur_lexical.c .PHONY : clean clean: - - rm -f $(OBJ) - - rm -f test_yylex + @echo "Clean .o files" + rm -rf */*.o + +mrproper: clean + @echo "Remove $(EXEC) file" + rm -rf $(EXEC) + +doxygen: + @echo "Generate Doxygen documentation" + rm -rf documentation/* + doxygen config_doxygen.conf + +rebuild: + @echo " --- Cleaning --- " + make mrproper + @echo " \n\n--- Building --- " + make all