aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/buildsys/gnumake.mak
blob: 5b1917029d0a0edea3de1daa0e354a41613d1b5b (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# required settings:
#
# PLATFORM - win/mac/lnx
# RTSYS - pd/max
# COMPILER - msvc/gcc/mingw/cygwin
# BUILDPATH including trailing /

# package info
USRINFO=package.txt

include $(USRINFO)


ifeq ($(PLATFORM),win)
	# substitute eventual \ by /
	UBUILDPATH=$(subst \,/,$(BUILDPATH))
else
	UBUILDPATH=$(BUILDPATH)
endif


SYSCONFIG=$(UBUILDPATH)config-$(PLATFORM)-$(RTSYS)-$(COMPILER).txt
SYSDEFAULT=$(UBUILDPATH)$(PLATFORM)/$(RTSYS)/config-$(COMPILER).def


OPTIONS=-f $(UBUILDPATH)gnumake-sub.mak \
	PLATFORM=$(PLATFORM) RTSYS=$(RTSYS) COMPILER=$(COMPILER) \
	BUILDPATH=$(UBUILDPATH) USRINFO=$(USRINFO)


ifdef BUILDDIR
USRCONFIG=config.txt
USRDEFAULT=$(BUILDDIR)/config-$(PLATFORM).def

USRMAKE=$(BUILDDIR)/makefile-$(PLATFORM)-$(COMPILER).inc

OPTIONS+=USRCONFIG=$(USRCONFIG) USRMAKE=$(USRMAKE)
endif


ifdef FLEXTBUILD
all: flext
else
all: build-sr

shared: build-tr
endif

flext: flext-release flext-debug

flext-release: build-dr build-tr build-sr

flext-debug: build-dd build-td build-sd

install: install-dr install-tr install-sr install-dd install-td install-sd

clean: clean-dr clean-tr clean-sr clean-dd clean-td clean-sd


build-sr: config
	$(MAKE) $(OPTIONS) _all_

build-sd: config
	$(MAKE) $(OPTIONS) DEBUG=1 _all_

build-tr: config
	$(MAKE) $(OPTIONS) THREADED=1 _all_

build-td: config
	$(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _all_

build-dr: config
	$(MAKE) $(OPTIONS) SHARED=1 _all_

build-dd: config
	$(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _all_


install-sr:
	$(MAKE) $(OPTIONS) _install_

install-sd:
	$(MAKE) $(OPTIONS) DEBUG=1 _install_

install-tr:
	$(MAKE) $(OPTIONS) THREADED=1 _install_

install-td:
	$(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _install_

install-dr:
	$(MAKE) $(OPTIONS) SHARED=1 _install_

install-dd:
	$(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _install_


clean-sr:
	$(MAKE) $(OPTIONS) _clean_

clean-sd:
	$(MAKE) $(OPTIONS) DEBUG=1 _clean_

clean-tr:
	$(MAKE) $(OPTIONS) THREADED=1 _clean_

clean-td:
	$(MAKE) $(OPTIONS) THREADED=1 DEBUG=1 _clean_

clean-dr:
	$(MAKE) $(OPTIONS) SHARED=1 _clean_

clean-dd:
	$(MAKE) $(OPTIONS) SHARED=1 DEBUG=1 _clean_



config: $(USRMAKE) $(SYSCONFIG) $(USRCONFIG) 


.precious: $(SYSCONFIG) $(USRCONFIG)

$(SYSCONFIG): $(SYSDEFAULT)
	@cp $< $@
	@echo -------------------------------------------------------------------------
	@echo A default system configuration file has been created.
	@echo Please edit $(SYSCONFIG) 
	@echo to match your platform, then start again.
	@echo -------------------------------------------------------------------------
	@false

ifdef BUILDDIR	
$(USRCONFIG): $(USRDEFAULT)
	@cp $< $@
	@echo -------------------------------------------------------------------------
	@echo A default package configuration file has been created.
	@echo Please edit $(USRCONFIG), then start again.
	@echo -------------------------------------------------------------------------
	@false

$(USRDEFAULT) $(USRMAKE):
	@echo -------------------------------------------------------------------------
	@echo Your combination of platform, system and compiler is not supported yet.
	@echo Required files: 
	@echo $(USRDEFAULT)
	@echo and
	@echo $(USRMAKE)
	@echo -------------------------------------------------------------------------
	@false
endif