26 lines
395 B
Makefile
26 lines
395 B
Makefile
|
|
|
|
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)
|
|
|
|
$(ODIR)/%.o : $(SRCDIR)/%.c
|
|
@mkdir -p $(@D)
|
|
$(CC) -c $< -o $@
|
|
|
|
$(EXE) : $(OFILES)
|
|
$(CC) $(CFLAGS) -o $(EXE) $(OFILES)
|
|
|
|
run : $(EXE)
|
|
./$(EXE)
|
|
|
|
clean : -rm -f $(OFILES) snake
|
|
|
|
.PHONY : but clean
|