Création du fichier Makefile
This commit is contained in:
parent
b4efffc298
commit
495bf28cad
34
Makefile
Normal file
34
Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
### VARIABLES ###
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -lgraph
|
||||
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 ###
|
||||
|
||||
start : $(EXE)
|
||||
./$(EXE)
|
||||
|
||||
clean :
|
||||
-rm -rf $(ODIR)
|
||||
|
||||
### BUTS FACTICES ###
|
||||
|
||||
.PHONY : but start clean
|
Loading…
Reference in New Issue
Block a user