-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile-windows
34 lines (26 loc) · 1.38 KB
/
makefile-windows
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
CC=g++
STD=c++11
CFLAGS=-W --std=$(STD) -Wno-write-strings -lm
TARGET_NAME=./top-gear
BUILD_PATH=./build
SOURCE_PATH=./src
LIB_PATH=./include
OUTPUT_PATH=./output
SOURCE_EXT=cpp
SOURCES=$(SOURCE_PATH)/car.cpp $(SOURCE_PATH)/colors.cpp $(SOURCE_PATH)/display.cpp $(SOURCE_PATH)/environment.cpp $(SOURCE_PATH)/fonts.cpp $(SOURCE_PATH)/game.cpp $(SOURCE_PATH)/maps.cpp $(SOURCE_PATH)/menus.cpp $(SOURCE_PATH)/object.cpp $(SOURCE_PATH)/sounds.cpp $(SOURCE_PATH)/utils.cpp
OBJECTS := $(patsubst $(SOURCE_PATH)/%,$(BUILD_PATH)/%,$(SOURCES:.$(SOURCE_EXT)=.o))
ALLEGRO_PATH=allegro
ALLEGRO_LIBS=-lallegro_monolith-static -static -lallegro -lallegro_acodec -lallegro_audio -lallegro_color -lallegro_dialog -lallegro_image -lallegro_main -lallegro_memfile -lallegro_physfs -lallegro_primitives -lallegro_ttf -lallegro_font -lallegro
ALLEGRO_INCLUDE=-I $(ALLEGRO_PATH)/include
ALLEGRO_BIN=-L $(ALLEGRO_PATH)/lib
ALLEGRO_CONFIG=$(ALLEGRO_INCLUDE) $(ALLEGRO_BIN) $(ALLEGRO_LIBS)
ALEGRO_MONOLITH=$(ALLEGRO_PATH)/lib/liballegro-5.0.10-monolith-mt.a
all: $(TARGET_NAME)
$(BUILD_PATH)/%.o: $(SOURCE_PATH)/%.$(SOURCE_EXT) $(LIB_PATH)/%.hpp
$(CC) -c $(CFLAGS) $(ALLEGRO_CONFIG) -o $@ $<
$(TARGET_NAME): $(OBJECTS) main.cpp
$(CC) $(CFLAGS) -o $(BUILD_PATH)$(TARGET_NAME) main.cpp $(OBJECTS) $(ALEGRO_MONOLITH)
setup:
cp $(ALLEGRO_PATH)/bin/* $(BUILD_PATH)/
run:
$(BUILD_PATH)$(TARGET_NAME)