1 compileargs ::= -g -Wall -Wextra -Wpedantic
3 libraries ::= -L/usr/local/lib -lGL -lglut -lassimp
4 # Prefix all object file names with the compilation directory
5 objects ::= $(addprefix out/, \
6 main.o debugutil.o glut_janitor.o render.o \
7 tga.o level.o performance.o)
9 # Set executable extension for the platform
10 ifeq ($(OS),Windows_NT)
15 binary ::= out/shadowclad$(binext)
17 # Default target: build executable
18 $(binary) : $(objects) | out
19 @echo "###### Linking executable..."
20 $(CC) $(linkargs) -o $(binary) $(objects) $(libraries)
22 # Alias for default target
23 shadowclad : $(binary)
29 LD_LIBRARY_PATH=/usr/local/lib $(binary)
32 # Create compilation directory
40 # Build each compilation unit
42 out/main.o : main.c debugutil.h glut_janitor.h render.h level.h performance.h | out
43 $(CC) $(compileargs) -c -o out/main.o main.c
45 out/debugutil.o : debugutil.c assimp_types.h | out
46 $(CC) $(compileargs) -c -o out/debugutil.o debugutil.c
48 out/glut_janitor.o : glut_janitor.c | out
49 $(CC) $(compileargs) -c -o out/glut_janitor.o glut_janitor.c
51 out/render.o : render.c render.h level.h typedefs.h performance.h | out
52 $(CC) $(compileargs) -c -o out/render.o render.c
54 out/tga.o : tga.c tga.h | out
55 $(CC) $(compileargs) -c -o out/tga.o tga.c
57 out/level.o : level.c level.h assimp_types.h tga.h | out
58 $(CC) $(compileargs) -c -o out/level.o level.c
60 out/performance.o : performance.c | out
61 $(CC) $(compileargs) -c -o out/performance.o performance.c