-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
66 lines (47 loc) · 1.9 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
62
63
64
65
66
PROJECT = SlideABlob
GCC = gcc -xc++ -lstdc++ -shared-libgcc -Wall
SDL = `sdl-config --cflags --libs`
STATIC = # -static -static-libstdc++ -static-libgcc
BUILD_DIR = output
SRC =
# different main trails.
MAIN = src/main.cpp
TEST_MAIN =
HEADER = src/*.h
ICON=res/blobs_icon-alpha.bmp
# ---
build: $(BUILD_DIR)/$(PROJECT) $(BUILD_DIR)/$(PROJECT).desktop
$(BUILD_DIR)/$(PROJECT): $(SRC) $(MAIN) $(HEADER) $(BUILD_DIR)
@echo "SDL build."
$(GCC) -o $(BUILD_DIR)/$(PROJECT) $(SDL) $(SRC) $(MAIN)
test: $(SRC) $(TEST_MAIN) $(HEADER) $(BUILD_DIR)
@echo "Test."
$(GCC) $(STATIC) -o $(BUILD_DIR)/$(PROJECT) $(SRC) $(TEST_MAIN)
run: $(BUILD_DIR)/$(PROJECT) res/field_colours.bmp
cd $(BUILD_DIR) && ./$(PROJECT)
res/field_colours.bmp: res/field_colours.sh
@echo -e "Update Field Tiles (colours)."
@bash res/field_colours.sh
$(BUILD_DIR)/$(PROJECT).desktop: $(BUILD_DIR) $(BUILD_DIR)/$(PROJECT).ico
@echo -e '[Desktop Entry]' > $(BUILD_DIR)/SlideABlob.desktop
@echo -e 'Name=Slide a Blob' >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e 'Comment=Slide a Lama Clone, made by Nox' >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e 'Encoding=UTF-8' >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e 'Type=Application' >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e 'Categories=Game;' >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e "Path=${PWD}/$(BUILD_DIR)" >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e "Exec=${PWD}/$(BUILD_DIR)/$(PROJECT)" >> $(BUILD_DIR)/SlideABlob.desktop
@echo -e "Icon=${PWD}/$(BUILD_DIR)/$(PROJECT).ico" >> $(BUILD_DIR)/SlideABlob.desktop
$(BUILD_DIR)/$(PROJECT).ico: $(BUILD_DIR)
@convert res/blobs_icon.bmp -transparent '#ff00ff' $(BUILD_DIR)/$(PROJECT).ico
.PHONY: $(BUILD_DIR)
$(BUILD_DIR):
@mkdir -vp $(BUILD_DIR)/res
@cp -uvr res/*.bmp $(BUILD_DIR)/res
# ---
clean:
rm -vrf $(BUILD_DIR)
options:
@echo "- build ........ build"
@echo "- test ......... test"
@echo "- clean ........ remove the built directory"