Commit f172143253fcb890872dcdc942fb20884a338822
1 parent
2e6754df
rapport finale
Showing
1 changed file
with
18 additions
and
22 deletions
Show diff stats
makefile
1 | -# Makefile for the graphical library (libgraph.a) | |
1 | +TARGET= project | |
2 | +CFLAGS=-g -W -Wall -Wextra | |
3 | +LDFLAGS=-lgraph -Lgraphique -lSDL -lSDL_ttf | |
4 | +OBJETS=main.o liste.o src/Graphique/libgraph.a | |
2 | 5 | |
3 | -# Compiler and archiver | |
4 | -CC = gcc | |
5 | -AR = ar | |
6 | -CFLAGS = -Wall -g | |
7 | -ARFLAGS = rs | |
6 | +default: $(TARGET) | |
8 | 7 | |
9 | -# Source files and objects | |
10 | -SOURCES = $(wildcard *.c) | |
11 | -OBJETS = $(SOURCES:.c=.o) | |
12 | -CIBLE = libgraph.a | |
8 | +liste.o: liste.c liste.h | |
9 | + gcc $(CFLAGS) -c liste.c | |
13 | 10 | |
14 | -# Main target | |
15 | -.PHONY: all | |
16 | -all: $(CIBLE) | |
17 | - | |
18 | -# Clean rule | |
19 | -.PHONY: clean | |
20 | -clean: | |
21 | - rm -f core *.o $(CIBLE) | |
22 | - | |
23 | -# Dependencies for the library | |
24 | -$(CIBLE): $(OBJETS) | |
25 | - $(AR) $(ARFLAGS) $@ $^ | |
11 | +main.o: main.c liste.h src/Graphique/libgraph.h | |
12 | + gcc $(CFLAGS) -c main.c | |
26 | 13 | |
14 | +Graphique/libgraph.a: | |
15 | + cd src/Graphique/ && $(MAKE) | |
16 | + cd .. | |
27 | 17 | |
18 | +$(TARGET): $(OBJETS) | |
19 | + clang $(OBJETS) -o $(TARGET) $(LDFLAGS) | |
28 | 20 | |
21 | +.PHONY: clean | |
22 | +clean: | |
23 | + rm -f *.o | |
24 | + rm -f $(TARGET) | |
29 | 25 | \ No newline at end of file | ... | ... |