forked from Amanieu/unvanquished-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (78 loc) · 2.39 KB
/
Makefile
File metadata and controls
98 lines (78 loc) · 2.39 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#########################
# Unvanquished Makefile #
#########################
#############################################################################
# SETUP
#############################################################################
COMPILE_PLATFORM = $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]')
COMPILE_ARCH = $(shell uname -m | sed -e s/i.86/x86/)
ifeq ($(COMPILE_PLATFORM), darwin)
COMPILE_ARCH = $(shell uname -p | sed -e s/i.86/x86/)
else ifeq ($(COMPILE_PLATFORM), windowsnt)
COMPILE_PLATFORM = mingw32
endif
ifeq ($(COMPILE_ARCH), powerpc)
COMPILE_ARCH = ppc
else ifeq ($(COMPILE_ARCH), powerpc64)
COMPILE_ARCH = ppc64
else ifeq ($(COMPILE_ARCH), amd64)
COMPILE_ARCH = x86_64
endif
# User configuration
-include Makefile.local
# Platform and architecture to build for, change these for cross-compiling
export PLATFORM ?= $(COMPILE_PLATFORM)
export ARCH ?= $(COMPILE_ARCH)
# Debug build
export DEBUG ?= 0
ifeq ($(DEBUG), 1)
export BUILD_DIR = build/debug-$(PLATFORM)-$(ARCH)
else
export BUILD_DIR = build/release-$(PLATFORM)-$(ARCH)
endif
#############################################################################
# TARGETS
#############################################################################
# You can set the default targets in Makefile.local
TARGETS ?= help
default: $(TARGETS)
help:
@echo "Pseudo-targets:"
@echo " all - Build all targets"
@echo " clean - Remove build files"
@echo
@echo "Targets:"
@echo " engine - Engine binary"
@echo " game - Game module"
@echo " server - Dedicated server"
@echo " editor - Editor"
@echo " test - Unit tests"
all: engine game server editor
clean:
@rm -rf build
engine:
@echo ====================
@echo Building engine binary
@echo ====================
@$(MAKE) -f Makefile.sub TARGET=engine
game:
@echo ====================
@echo Building game module
@echo ====================
@$(MAKE) -f Makefile.sub TARGET=game
server:
@echo =========================
@echo Building dedicated server
@echo =========================
@$(MAKE) -f Makefile.sub TARGET=server
editor:
@echo ===============
@echo Building editor
@echo ===============
@$(MAKE) -f Makefile.sub TARGET=editor
test:
@echo ===================
@echo Building unit tests
@echo ===================
@$(MAKE) -f Makefile.sub TARGET=test
.PHONY: default help all clean distclean engine game server editor test