51 lines
1.3 KiB
Makefile
51 lines
1.3 KiB
Makefile
# Dossiers contenant les fichiers sources, les en-têtes
|
|
# et les sorties
|
|
SRC=src/
|
|
INC=inc/
|
|
OUT=out/
|
|
|
|
# Configuration du compilateur
|
|
CC=gcc
|
|
CFLAGS=-Wall -std=c99 -I$(INC) -g
|
|
|
|
# Objets et exécutables à construire
|
|
PROG=huffman
|
|
SOURCES=$(wildcard $(SRC)*.c)
|
|
OBJECTS=$(patsubst $(SRC)%.c,$(OUT)%.o,$(SOURCES))
|
|
|
|
#####################################################
|
|
|
|
all: $(OUT) $(OUT)$(PROG) docs
|
|
|
|
# Création du dossier de sortie
|
|
$(OUT):
|
|
mkdir -p $(OUT)
|
|
|
|
# Génération de la documentation
|
|
docs: $(OUT)
|
|
doxygen
|
|
$(MAKE) -C $(OUT)doxygen/latex
|
|
|
|
# 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
|
|
$(OUT)buffer.o: $(SRC)buffer.c $(INC)buffer.h
|
|
$(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
|
|
|
|
$(OBJECTS):
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
# Nettoyage du dossier de sortie
|
|
clean:
|
|
rm -rf out
|