diff --git a/makefile b/makefile index eb46699..e8d5cfc 100644 --- a/makefile +++ b/makefile @@ -1,28 +1,24 @@ -# Makefile for the graphical library (libgraph.a) +TARGET= project +CFLAGS=-g -W -Wall -Wextra +LDFLAGS=-lgraph -Lgraphique -lSDL -lSDL_ttf +OBJETS=main.o liste.o src/Graphique/libgraph.a -# Compiler and archiver -CC = gcc -AR = ar -CFLAGS = -Wall -g -ARFLAGS = rs +default: $(TARGET) -# Source files and objects -SOURCES = $(wildcard *.c) -OBJETS = $(SOURCES:.c=.o) -CIBLE = libgraph.a +liste.o: liste.c liste.h + gcc $(CFLAGS) -c liste.c -# Main target -.PHONY: all -all: $(CIBLE) - -# Clean rule -.PHONY: clean -clean: - rm -f core *.o $(CIBLE) - -# Dependencies for the library -$(CIBLE): $(OBJETS) - $(AR) $(ARFLAGS) $@ $^ +main.o: main.c liste.h src/Graphique/libgraph.h + gcc $(CFLAGS) -c main.c +Graphique/libgraph.a: + cd src/Graphique/ && $(MAKE) + cd .. +$(TARGET): $(OBJETS) + clang $(OBJETS) -o $(TARGET) $(LDFLAGS) +.PHONY: clean +clean: + rm -f *.o + rm -f $(TARGET) \ No newline at end of file -- libgit2 0.21.2