SAE11_2023/SAE_semestre1/Makefile

26 lines
395 B
Makefile
Raw Normal View History

2023-11-30 13:44:06 +01:00
CC = gcc
CFLAGS = -ansi -pedantic -lgraph -g
SRCDIR = ./src
HDIR = ./fichier.h
ODIR = ./out
OFILES = $(subst src/,out/,$(subst .c,.o,$(shell find $(SRCDIR)/ -type f)))
EXE = snake
but : $(EXE)
2023-11-30 13:44:06 +01:00
$(ODIR)/%.o : $(SRCDIR)/%.c
@mkdir -p $(@D)
$(CC) -c $< -o $@
2023-11-30 13:44:06 +01:00
$(EXE) : $(OFILES)
$(CC) $(CFLAGS) -o $(EXE) $(OFILES)
2023-11-30 13:44:06 +01:00
run : $(EXE)
./$(EXE)
clean : -rm -f $(OFILES) snake
2023-11-30 13:44:06 +01:00
.PHONY : but clean