-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (26 loc) · 941 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CC = g++
CFLAGS = -ansi -pedantic -Wall -std=c++11
LDFLAGS =
SOURCE = src/
BINARY = bin/
SRC = $(wildcard $(SOURCE)*.cpp)
HDR = $(wildcard $(SOURCE)*.h)
OBJ = $(patsubst $(SOURCE)%.cpp,$(BINARY)%.o, $(SRC))
EXEC = analog
all: $(EXEC)
analog: $(OBJ) # édition des liens
$(CC) -o $@ $^ $(LDFLAGS)
$(BINARY)%.o: $(SOURCE)%.cpp $(SOURCE)%.h # compilations classiques
$(CC) -o $@ -c $< $(CFLAGS)
$(BINARY)main.o: $(SOURCE)main.cpp $(SOURCE)Traitement.h $(SOURCE)Lecture.h # compilation
$(CC) -o $@ -c $< $(CFLAGS)
$(BINARY)Traitement.o: $(SOURCE)Traitement.cpp $(SOURCE)Traitement.h $(SOURCE)Lecture.h $(SOURCE)Log.h $(SOURCE)Extension.h # compilations
$(CC) -o $@ -c $< $(CFLAGS)
$(BINARY)Lecture.o: $(SOURCE)Lecture.cpp $(SOURCE)Lecture.h $(SOURCE)Log.h # compilations
$(CC) -o $@ -c $< $(CFLAGS)
.PHONY: clean mrproper
clean:
rm $(BINARY)*
mrproper:
rm $(BINARY)* $(EXEC)
# https://gl.developpez.com/tutoriel/outil/makefile/