-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
43 lines (34 loc) · 1.1 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
CC = g++
CCVER = -std=c++0x
TARGETNAME = LightPropagationVolumes
ENVIRONMENT = -D ENV_SDL
ifeq ($(OS), Windows_NT)
CCFLAGS =
LDFLAGS = -static-libgcc -static-libstdc++ -mwindows -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
LIBS = -lopengl32 -lSDL2 -lSDL2_image
RM = del /S
RUN =
else
CCFLAGS =
LDFLAGS =
LIBS = -lGL -lX11 -lSDL2 -lSDL2_image
RM = rm -f
RUN = ./
endif
CFLAGS = -pedantic -Wall -Wextra -Wdouble-promotion -Wunreachable-code -O3 $(CCVER) $(CCFLAGS) $(ENVIRONMENT) -c
SRC = main.cpp engine.cpp window.cpp scenes.cpp models.cpp renderer.cpp shaders.cpp framebuffers.cpp maps.cpp openGL.cpp filesystem.cpp
OBJ = $(SRC:.cpp=.o)
SOURCES = $(addprefix src/, $(SRC))
OBJECTS = $(addprefix obj/, $(OBJ))
TARGET = bin/$(TARGETNAME).exe
all: $(SOURCES) $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
obj/%.o: src/%.cpp
$(CC) $(CFLAGS) $< -o $@
clean:
$(RM) *.o stdout.txt stderr.txt
run:
$(RUN)$(TARGET)
make-run: $(SOURCES) $(TARGET)
$(RUN)$(TARGET)