53c72792 |
ifeq ($(OS),Windows_NT)
OS = Windows
MICROGLUT = MicroGlut.c
else ifeq ($(shell uname),Linux)
OS = Linux
MICROGLUT = MicroGlut.c
else ifeq ($(shell uname),Darwin)
OS = Mac
MICROGLUT = MicroGlut.m
endif
|
1b863123 |
PROG = tsbk07
|
8145804f |
COMMON = \
common/GL_utilities.c \
common/LoadTGA.c \
|
53c72792 |
common/$(OS)/$(MICROGLUT)
|
8145804f |
CPPFLAGS += \
-Icommon \
|
9230c2a7 |
-Icommon/$(OS)
|
8145804f |
CXXFLAGS += \
|
789e9de1 |
-g \
|
58c95e1b |
-Wall \
-Wextra \
-Wpedantic \
-Wshadow
|
53c72792 |
LDLIBS_Windows += \
-lopengl32
LDLIBS_Linux += \
|
8145804f |
-lX11 \
|
53c72792 |
-lGL
LDLIBS_Mac += \
-framework Cocoa \
-framework OpenGL
LDLIBS += \
|
1d78d687 |
$(LDLIBS_$(OS))
|
7306701a |
|
1d78d687 |
# The below is equivalent to the GNU Make implicit rule for
|
1b863123 |
# $(PROG): $(COMMON)
$(PROG): $(PROG).cpp $(COMMON)
g++ $(CXXFLAGS) $(CPPFLAGS) $(PROG).cpp $(COMMON) $(LDLIBS) -o $(PROG)
|
7306701a |
|
c0ecdf15 |
.PHONY: clean
|
8145804f |
clean:
|
1b863123 |
rm $(PROG)
|
d352396b |
|
c0ecdf15 |
.PHONY: run
|
d352396b |
run: $(PROG)
./$(PROG)
|