summaryrefslogtreecommitdiff
path: root/Makefile.build
blob: b8fae45ea67898668f14fbb94be4fb78b71248be (plain)
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
# Make file for the uqm build system. Invoked from build/unix/build_functions
# By Serge van den Boom

.DELETE_ON_ERROR:

SOURCES := $(shell cat "$(DEPEND_FILE)")
-include $(SOURCES:=.d)

ifeq ($(MAKE_VERBOSE),1)
define act
	$(call $(1))
endef
else
define act
	@echo "  $(2)  $(3)"
	@$(call $(1))
endef
endif

ifeq ($(HOST_SYSTEM),ARMV5)
	include build/unix/make/buildtools-armv5
else
ifeq ($(HOST_SYSTEM),WINSCW)
	include build/unix/make/buildtools-winscw
else
ifeq ($(HOST_SYSTEM),GCCE)
	include build/unix/make/buildtools-gcce
else
	include build/unix/make/buildtools-generic
endif
endif
endif


default:
	./build.sh uqm

$(OBJDIR)%.c.d: $(BUILD_ROOT)%.c
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_mkdep_c,MKDEP  ,$@)

$(OBJDIR)%.cpp.d: $(BUILD_ROOT)%.cpp
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_mkdep_cxx,MKDEP  ,$@)

$(OBJDIR)%.m.d: $(BUILD_ROOT)%.m
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_mkdep_m,MKDEP  ,$@)

$(OBJDIR)%.rc.o: $(BUILD_ROOT)%.rc
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_windres,WINDRES,$@)

%.c.o:
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_cc,CC     ,$@)

%.cpp.o:
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_cxx,CXX    ,$@)

%.m.o:
	@DIR=$(dir $@); \
	if [ ! -d $$DIR ]; then \
		mkdir -p "$$DIR"; \
	fi
	$(call act,act_objcc,OBJCC  ,$@)

$(TARGET_FILE): $(SOURCES:=.o)
	$(call act,act_link,LINK   ,$@)