Browse code

Modularize Makefile

Robert Cranston authored on 27/02/2024 02:27:40
Showing 1 changed files

  • Makefile index d36085f..aa98cf7 100644
... ...
@@ -1,11 +1,22 @@
1
-# set this variable to the director in which you saved the common files
2
-commondir = common/
1
+COMMON = \
2
+	common/GL_utilities.c \
3
+	common/LoadTGA.c \
4
+	common/Linux/MicroGlut.c
5
+CPPFLAGS += \
6
+	-Icommon \
7
+	-Icommon/Linux \
8
+	-DGL_GLEXT_PROTOTYPES
9
+CXXFLAGS += \
10
+	-Wall
11
+LDLIBS += \
12
+	-lXt \
13
+	-lX11 \
14
+	-lGL \
15
+	-lm \
16
+	-lstdc++
3 17
 
4
-all : tsbk07
18
+tsbk07: tsbk07.cpp $(COMMON)
19
+	gcc $(CXXFLAGS) -o tsbk07 $(CPPFLAGS) tsbk07.cpp $(COMMON) $(LDLIBS)
5 20
 
6
-tsbk07 : tsbk07.cpp $(commondir)GL_utilities.c $(commondir)LoadTGA.c $(commondir)Linux/MicroGlut.c
7
-	gcc -Wall -o tsbk07 -I$(commondir) -Icommon/Linux -DGL_GLEXT_PROTOTYPES tsbk07.cpp $(commondir)GL_utilities.c $(commondir)LoadTGA.c $(commondir)Linux/MicroGlut.c -lXt -lX11 -lGL -lm -lstdc++
8
-
9
-clean :
21
+clean:
10 22
 	rm tsbk07
11
-