Ajout d'un Makefile

This commit is contained in:
Valentin Moguérou 2024-04-15 23:56:46 +02:00
parent 52fa0c1789
commit be83812716
1 changed files with 34 additions and 0 deletions

34
Makefile Normal file
View File

@ -0,0 +1,34 @@
CC=gcc
FLAGS=-g -Wall -Wextra -Wpedantic
LFLAGS=
all: bin/main
OBJECTS = obj/main.o obj/structure.o obj/display.o obj/algorithm.o
bin/main: bin $(OBJECTS)
$(CC) -o $@ $(LFLAGS) $(FLAGS) $(OBJECTS)
obj/main.o: main.c obj
$(CC) -o $@ -c $(FLAGS) $<
obj/structure.o: structure.c structure.h obj
$(CC) -o $@ -c $(FLAGS) $<
obj/display.o: display.c display.h obj
$(CC) -o $@ -c $(FLAGS) $<
obj/algorithm.o: algorithm.c algorithm.h obj
$(CC) -o $@ -c $(FLAGS) $<
bin:
mkdir -p bin
obj:
mkdir -p obj
.PHONY: clean
clean:
rm -rf bin/ obj/