1
0
SAE11_2022/Makefile

38 lines
530 B
Makefile
Raw Permalink Normal View History

2022-11-23 17:03:16 +01:00
### VARIABLES ###
CC = gcc
CFLAGS = -lgraph -ansi
2022-11-23 17:03:16 +01:00
SRCDIR = ./src
HDIR = ./include
ODIR = ./out
OFILES = $(subst src/,out/,$(subst .c,.o,$(shell find $(SRCDIR)/ -type f)))
EXE = game
### BUT PAR DEFAUT ###
but : $(EXE)
### REGLES ESSENTIELLES ###
$(ODIR)/%.o : $(SRCDIR)/%.c
@mkdir -p $(@D)
$(CC) -c $< -o $@
$(EXE) : $(OFILES)
$(CC) $(CFLAGS) -o $(EXE) $(OFILES)
### REGLES OPTIONNELLES ###
run : $(EXE)
2022-11-23 17:03:16 +01:00
./$(EXE)
clean :
-rm -rf $(ODIR)
mrproper :
clean but
2022-11-23 17:03:16 +01:00
### BUTS FACTICES ###
.PHONY : but run clean mrproper