-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (36 loc) · 1.15 KB
/
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
37
38
39
40
41
42
43
44
45
#------------------------------------------------------------------------
# CPP-SDL2 sketches
# Copyright (c) 2019-2020 - Trung Truong
#
# File name: Makefile
# Description: Create executables
#------------------------------------------------------------------------
OBJECTS = $(SOURCES:.c=.o)
# Compiler Flags
CC = gcc
C++ = g++
CFLAGS = -g -std=c99 -pedantic -Wall -Werror -Wextra \
-Wno-overlength-strings -Wfatal-errors -pedantic
C++FLAGS = -g -std=c++11 -pedantic -Wall -Werror -Wextra \
-Wno-overlength-strings -Wfatal-errors -pedantic
LDFLAGS = -lSDL2
CPPFLAGS = -I.
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
%.o: %.cpp $(DEPS)
$(C++) -c -o $@ $< $(CPPFLAGS) $(C++FLAGS)
# Clean up executables
clean:
rm -rf bin/* src/*.o tests/*.o core* *~ tests/test-*
# Make all executables
all:
make conway
make barnsley
make raycast
# Individual executables
barnsley: src/barnsley-fern.o
$(CC) $(LDFLAGS) -o bin/barnsley-fern src/barnsley-fern.o
raycast: src/ray-casting.o
$(C++) $(LDFLAGS) -o bin/raycast src/ray-casting.o
conway: src/conway.o
$(CC) $(LDFLAGS) -o bin/conway src/conway.o