2016-10-25 04:51:07 +00:00
|
|
|
# Dossiers contenant les fichiers sources, les en-têtes
|
|
|
|
# et les sorties
|
|
|
|
SRC=src/
|
|
|
|
INC=inc/
|
|
|
|
OUT=out/
|
|
|
|
|
|
|
|
# Configuration du compilateur
|
2016-10-05 10:52:58 +00:00
|
|
|
CC=gcc
|
2016-11-20 00:49:11 +00:00
|
|
|
CFLAGS=-Wall -std=c99 -I$(INC) -g
|
2016-10-25 04:51:07 +00:00
|
|
|
|
|
|
|
# Objets et exécutables à construire
|
2016-10-22 00:55:02 +00:00
|
|
|
PROG=huffman
|
2016-10-25 04:51:07 +00:00
|
|
|
SOURCES=$(wildcard $(SRC)*.c)
|
|
|
|
OBJECTS=$(patsubst $(SRC)%.c,$(OUT)%.o,$(SOURCES))
|
|
|
|
|
|
|
|
#####################################################
|
|
|
|
|
2016-11-30 10:55:20 +00:00
|
|
|
all: $(OUT) $(OUT)$(PROG) docs
|
2016-10-25 04:51:07 +00:00
|
|
|
|
2016-11-30 10:55:20 +00:00
|
|
|
# Création du dossier de sortie
|
2016-10-25 04:51:07 +00:00
|
|
|
$(OUT):
|
|
|
|
mkdir -p $(OUT)
|
|
|
|
|
2016-11-30 10:55:20 +00:00
|
|
|
# Génération de la documentation
|
|
|
|
docs: $(OUT)
|
|
|
|
doxygen
|
|
|
|
$(MAKE) -C $(OUT)doxygen/latex
|
2016-10-05 10:52:58 +00:00
|
|
|
|
2016-11-30 10:55:20 +00:00
|
|
|
# Génération du programme ./huffman
|
|
|
|
$(OUT)$(PROG): $(OUT) $(OBJECTS)
|
|
|
|
$(CC) $(OBJECTS) $(CFLAGS) -o $(OUT)$(PROG)
|
|
|
|
|
|
|
|
$(OUT)arguments.o: $(SRC)arguments.c $(INC)arguments.h $(INC)common.h
|
2016-10-27 13:36:51 +00:00
|
|
|
$(OUT)buffer.o: $(SRC)buffer.c $(INC)buffer.h
|
2016-11-30 10:55:20 +00:00
|
|
|
$(OUT)compress.o: $(SRC)compress.c $(INC)common.h $(INC)compress.h \
|
|
|
|
$(INC)buffer.h $(INC)huftree.h $(INC)display.h
|
|
|
|
$(OUT)decompress.o: $(SRC)decompress.c $(INC)huftree.h $(INC)buffer.h \
|
|
|
|
$(INC)display.h $(INC)decompress.h
|
|
|
|
$(OUT)display.o: $(SRC)display.c $(INC)common.h $(INC)display.h \
|
|
|
|
$(INC)huftree.h
|
|
|
|
$(OUT)huftree.o: $(SRC)huftree.c $(INC)common.h $(INC)huftree.h $(INC)buffer.h
|
|
|
|
$(OUT)main.o: $(SRC)main.c $(INC)common.h $(INC)display.h $(INC)compress.h \
|
|
|
|
$(INC)decompress.h $(INC)arguments.h
|
2016-10-05 10:52:58 +00:00
|
|
|
|
2016-10-25 04:51:07 +00:00
|
|
|
$(OBJECTS):
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
2016-10-05 10:52:58 +00:00
|
|
|
|
2016-11-30 10:55:20 +00:00
|
|
|
# Nettoyage du dossier de sortie
|
2016-10-12 10:28:38 +00:00
|
|
|
clean:
|
2016-10-25 04:51:07 +00:00
|
|
|
rm -rf out
|