source: opengl-game/makefile@ 8e232ce

feature/imgui-sdl points-test
Last change on this file since 8e232ce was 8e232ce, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 7 years ago

Fix the error where unchanged .cpp dependencies don't get included in the build command generated by make

  • Property mode set to 100644
File size: 860 bytes
Line 
1OS = $(shell uname)
2CC = g++
3CFLAGS = -std=c++0x -Wall -pedantic #-Wextra
4
5ifeq ($(OS),Darwin)
6 DEP = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw3 -lglew
7endif
8ifeq ($(OS),Linux)
9 DEP = -lglfw3 -lGLEW -lGL -ldl -lX11 -lXrandr -lXxf86vm -lXinerama -lXcursor -pthread
10endif
11
12# If I were generating.o files as well, I should use $? instead of $^
13# as this well prevent regenerating .o files for unchanged .cpp files
14
15newgame: new-game.cpp logger.cpp
16 $(CC) $^ $(DEP) $(CFLAGS) -o $@
17
18pong: pong.cpp logger.cpp
19 $(CC) $^ $(DEP) $(CFLAGS) -o $@
20
21mygame: mygame.cpp common/shader.cpp common/texture.cpp common/controls-new.cpp
22 $(CC) $^ $(DEP) $(CFLAGS) -o $@
23
24demo: game06.cpp common/shader.cpp common/texture.cpp common/controls.cpp
25 $(CC) $^ $(DEP) $(CFLAGS) -o $@
26
27clean:
28 rm -f newgame
29 rm -f pong
30 rm -f mygame
31 rm -f demo
Note: See TracBrowser for help on using the repository browser.