-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (29 loc) · 1.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# My Windows Setup:
# LIBS_ROOT=E:
# OPENGL_LIB=-lopengl32
# EXE_EXTENSION=.exe
# My OSX Setup:
LIBS_ROOT=/Users/markoates/Repos
OPENGL_LIB=-framework OpenGL
EXE_EXTENSION=
ALLEGRO_DIR=$(LIBS_ROOT)/allegro5
ALLEGRO_LIBS=-lallegro_color -lallegro_font -lallegro_ttf -lallegro_dialog -lallegro_audio -lallegro_acodec -lallegro_primitives -lallegro_image -lallegro_main -lallegro
ALLEGRO_FLARE_DIR=$(LIBS_ROOT)/allegro_flare
ALLEGRO_FLARE_LIB=allegro_flare-0.8.9wip
# ALLEGRO_FLARE_LIB=allegro_flare-0.8.7wip
all: bin/game$(EXE_EXTENSION)
SOURCES := $(shell find src -name '*.cpp')
OBJECTS := $(SOURCES:src/%.cpp=obj/%.o)
REQUIRED_DIRECTORIES := $(dir $(OBJECTS))
bin/game$(EXE_EXTENSION): $(OBJECTS) obj/game.o
g++ $^ -o bin/game $(OPENGL_LIB) -l$(ALLEGRO_FLARE_LIB) $(ALLEGRO_LIBS) -L$(ALLEGRO_FLARE_DIR)/lib -L$(ALLEGRO_DIR)/build/lib
obj/%.o: src/%.cpp | required_obj_dirs
g++ -c -std=gnu++11 $< -o $@ -I$(ALLEGRO_FLARE_DIR)/include -I$(ALLEGRO_DIR)/include -I./include
required_obj_dirs:
@mkdir -p $(REQUIRED_DIRECTORIES)
obj/game.o: main.cpp include/style_assets.hpp include/logging.hpp include/start_screen_gui/screen.hpp include/script_collection.hpp include/world_render_screen.hpp game/project.hpp game/load_game_scripts.hpp $(wildcard game/scripts/*)
g++ -o $@ -c -std=gnu++11 $< -I$(ALLEGRO_FLARE_DIR)/include -I$(ALLEGRO_DIR)/include -I./include
clean:
-rm $(OBJECTS)
-rm obj/game.o
-rm bin/game