summaryrefslogtreecommitdiff
path: root/bin/MakeProjectCreator/templates/make.mpd
blob: 65cfc97dac582ebb6290c767c7f1c6cdca1cfdd9 (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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#----------------------------------------------------------------------------
#       Macros
#----------------------------------------------------------------------------
<%marker(top)%>
<%foreach(configurations)%>
CXX           = <%cxx%>
<%if(ld)%>
LD            = <%ld%>
<%else%>
LD            = $(CXX) $(CCFLAGS) $(CPPFLAGS)
<%endif%>
<%if(ar)%>
AR            = <%ar%>
<%endif%>
<%if(nm)%>
NM            = <%nm%>
<%endif%>
<%if(cputype)%>
CPUTYPE       = <%cputype%>
<%endif%>
<%if(cpu)%>
CPU           = <%cpu%>
<%endif%>
<%endfor%>
CCC           = $(CXX)
MAKEFILE      = <%project_file%>
DEPENDENCIES  = .depend.$(MAKEFILE)
<%if(exename)%>
BIN           = <%exename%>$(EXEEXT)
<%endif%>
<%if(staticname)%>
LIB           = lib<%staticname%>.a
<%endif%>
<%foreach(platforms)%>
EXEEXT        = <%exeext%>
<%if(soext)%>
<%if(sharedname)%>
SHLIB         = lib<%sharedname%>.$(SOEXT)
SOEXT         = <%soext%>
LN            = <%ln%>
<%foreach(configurations)%>
<%if(pic)%>
PICFLAGS      = <%pic%>
<%endif%>
<%endfor%>
<%if(shflags)%>
SHFLAGS       = <%shflags%>
<%endif%>
<%endif%>
<%endif%>
<%endfor%>
<%foreach(configurations)%>
<%if(tempinc)%>
TEMPINCDIR    = <%tempinc%>/<%project_name%>
<%endif%>
<%endfor%>
GENFLAGS      = <%genflags(-g)%>
CPPFLAGS      = $(PICFLAGS) $(GENFLAGS)<%if(cppflags)%> <%cppflags%><%endif%><%foreach(configurations)%><%if(compileflags)%> <%compileflags%><%endif%><%if(cpu)%> -DCPU=$(CPU)<%endif%><%if(tempinc)%> <%tempincopt%>$(TEMPINCDIR)<%endif%><%endfor%><%foreach(platforms)%><%if(extracppflags)%> <%extracppflags%><%endif%><%endfor%><%foreach(configurations)%><%if(compilerflags)%> <%compilerflags%><%endif%><%endfor%><%if(pch_header)%><%foreach(pch_defines)%> -D<%pch_define%><%endfor%><%endif%><%if(includes)%><%foreach(includes)%> -I<%include%><%endfor%><%endif%><%if(macros)%><%foreach(macros)%> -D<%macro%><%endfor%><%endif%>
<%if(arflags)%>
ARFLAGS       = <%arflags%>
<%endif%>
<%if(idl_files)%>
IDL_FILES     =<%foreach(idl_files)%> <%noextension(idl_file)%><%endfor%>
IDL_SRC       =<%foreach(idl_files)%> <%noextension(idl_file)%>C.cpp <%noextension(idl_file)%>S.cpp<%endfor%>
<%endif%>
SRC           =<%foreach(source_files)%> <%source_file%><%endfor%>
OBJS          =<%foreach(source_files)%> <%noextension(source_file)%>.o<%endfor%>
LDFLAGS       =<%if(libpaths)%><%foreach(libpaths)%> -L<%libpath%><%endfor%><%endif%><%foreach(configurations)%><%if(linkflags)%> <%linkflags%><%endif%><%endfor%>
LDLIBS        =<%if(libs)%><%foreach(libs)%> -l<%lib%><%endfor%><%endif%><%if(defaultlibs)%><%foreach(defaultlibs)%> -l<%defaultlib%><%endfor%><%endif%><%if(lit_libs)%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%endif%><%foreach(platforms)%> <%ldlibs%><%endfor%>
LINK.cc       = $(LD) $(LDFLAGS)
COMPILE.cc    = $(CXX) $(CCFLAGS) $(CPPFLAGS)  -c
RM            = rm -f
OUTPUT_OPTION = -o $@
<%marker(macros)%>

#----------------------------------------------------------------------------
#       Local targets
#----------------------------------------------------------------------------
<%marker(local)%>

<%if(custom_types)%>
GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%>
<%foreach(custom_types)%>
<%if(custom_types->libpath)%>
DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%>
LD_LIBRARY_PATH   := $(LD_LIBRARY_PATH):<%custom_type->libpath%>
SHLIB_PATH        := $(SHLIB_PATH):<%custom_type->libpath%>
LIBPATH           := $(LIBPATH):<%custom_type->libpath%>
PATH              := $(PATH):<%custom_type->libpath%>

<%endif%>
<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
<%foreach(custom_type->input_file->output_files)%>
<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>: <%custom_type->input_file%>
	<%custom_type->command%> <%if(pch_header)%><%if(custom_type->pch_option)%><%custom_type->pch_option%><%pch_header%> <%endif%><%endif%><%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%custom_type->input_file%> <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%>

<%endfor%>
<%endif%>
<%endfor%>
<%endfor%>
.PRECIOUS: $(GENERATED_DIRTY)
all: $(GENERATED_DIRTY)

<%endif%>
<%foreach(configurations)%>
<%if(tempinc)%>
all: $(TEMPINCDIR)

$(TEMPINCDIR):
	@-test -d $(TEMPINCDIR) || mkdir -p $(TEMPINCDIR) 2> /dev/null || true

<%endif%>
<%endfor%>
<%if(exename)%>
all: $(BIN) <%if(install)%>install<%endif%>

<%foreach(configurations)%>
<%foreach(platforms)%>
<%if(specialscript)%>
specialscript:
	@echo '<%specialscript%>' > specialscript
	@chmod 755 specialscript

<%endif%>
<%if(prelink)%>
<%prelink%>: specialscript $(OBJS)
	@specialscript $(NM) "$(OBJS)" "$(LDLIBS)" "<%if(libpaths)%><%libpaths%><%else%>.<%endif%>" <%prelink%>
	@$(RM) specialscript

<%noextension(prelink)%>.o: <%prelink%>
	$(COMPILE.cc) <%prelink%> $(OUTPUT_OPTION)
	@$(RM) <%prelink%>

<%endif%>
<%endfor%>
<%endfor%>
$(BIN): $(OBJS) <%foreach(configurations)%><%foreach(platforms)%><%if(prelink)%><%noextension(prelink)%>.o<%endif%><%endfor%><%endfor%>
	$(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)

<%endif%>
<%foreach(platforms)%>
<%if(soext)%>
<%if(sharedname)%>
INSTARGET = $(SHLIB)

all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%>

$(SHLIB): $(OBJS)
	<%foreach(configurations)%><%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%><%endfor%> $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)
<%else%>
INSTARGET = $(LIB)

all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%>
<%endif%>

<%else%>
<%if(staticname)%>
INSTARGET = $(LIB)

all: $(INSTARGET) <%if(install)%>install<%else%><%if(!exename)%>install<%endif%><%endif%>

<%endif%>
<%endif%>
<%endfor%>
<%if(staticname)%>
$(LIB): $(OBJS)
	$(AR) $(ARFLAGS) $(LIB) $(OBJS)<%foreach(configurations)%><%if(tempinc)%> `find $(TEMPINCDIR) -type f`<%endif%><%endfor%>

<%endif%>
<%foreach(source_files)%>
<%noextension(source_file)%>.o: <%source_file%>
	$(COMPILE.cc) <%source_file%> $(OUTPUT_OPTION)

<%endfor%>
<%if(install)%>
<%if(exename)%>
INSTARGET = $(BIN)
install:
	@if [ "<%install%>" != "." ]; then \
	echo "Installing $(INSTARGET) -> <%install%>/$(INSTARGET)"; \
	-test -d "<%install%>" || mkdir -p "<%install%>" 2> /dev/null || true; \
	$(RM) "<%install%>/$(INSTARGET)"; \
	$(LN) "$(PWD)/$(INSTARGET)" "<%install%>"; \
	fi

<%endif%>
<%else%>
<%if(!exename)%>
install:
	@if [ "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" != "." ]; then \
	test -d "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" || mkdir -p "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>" 2> /dev/null || true; \
	$(RM) "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>/$(INSTARGET)"; \
	$(LN) "$(PWD)/$(INSTARGET)" "<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>"; \
	fi

<%endif%>
<%endif%>
clean:
	-$(RM) $(OBJS)
<%foreach(configurations)%>
<%if(clean)%>
	-$(RM) -r <%clean%>
<%endif%>
<%endfor%>

realclean: clean
	-$(RM) <%if(exename)%>$(BIN)<%else%>$(SHLIB) $(LIB)<%endif%><%if(install)%> <%install%>/$(INSTARGET)<%endif%>
<%if(custom_types)%>
	-$(RM) -r $(GENERATED_DIRTY)
<%endif%>

#----------------------------------------------------------------------------
#       Dependencies
#----------------------------------------------------------------------------

$(DEPENDENCIES):
	@touch $(DEPENDENCIES)

depend:
	<%depgen("makedepend -Y")%> $(CFLAGS) $(CCFLAGS) $(CPPFLAGS) -f $(DEPENDENCIES) $(SRC) 2> /dev/null

include $(DEPENDENCIES)
<%marker(bottom)%>