summaryrefslogtreecommitdiff
path: root/bin/MakeProjectCreator/templates/make.mpd
blob: d79c96058fb7b59c6c071dd79911850da093d028 (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
#----------------------------------------------------------------------------
#       Macros
#----------------------------------------------------------------------------
<%marker(top)%>
<%foreach(configurations)%>
CXX           = <%cxx%>
<%endfor%>
CCC           = $(CXX)
MAKEFILE      = <%project_file%>
<%if(exename)%>
BIN           = <%exename%>
<%endif%>
<%if(staticname)%>
LIB           = lib<%staticname%>.a
<%endif%>
<%if(sharedname)%>
SHLIB         = lib<%sharedname%>.$(SOEXT)
<%foreach(platforms)%>
SOEXT         = <%soext%>
<%endfor%>
<%foreach(configurations)%>
<%if(cppflags)%>
CPPFLAGS     += <%cppflags%>
<%endif%>
<%endfor%>
<%foreach(configurations)%>
CPPFLAGS     += <%pic%>
SHFLAGS       = <%shflags%>
<%endfor%>
<%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%>
<%if(includes)%>
CPPFLAGS     +=<%foreach(includes)%> -I<%include%><%endfor%>
<%endif%>
<%if(libpaths)%>
LDFLAGS      +=<%foreach(libpaths)%> -L<%libpath%><%endfor%>
<%endif%>
<%foreach(configurations)%>
<%if(linkflags)%>
LDFLAGS      += <%linkflags%>
<%endif%>
<%endfor%>
<%foreach(platforms)%>
LDLIBS       += <%ldlibs%>
<%endfor%>
<%if(libs)%>
LDLIBS       +=<%foreach(libs)%> -l<%lib%><%endfor%>
<%endif%>
<%if(defaultlibs)%>
LDLIBS       +=<%foreach(defaultlibs)%> -l<%defaultlib%><%endfor%>
<%endif%>
<%if(lit_libs)%>
LDLIBS       +=<%foreach(lit_libs)%> -l<%lit_lib%><%endfor%>
<%endif%>
<%if(ssl)%>
LDLIBS       +=<%foreach(ssl_libs)%> -l<%ssl_lib%><%endfor%>
<%endif%>
OUTPUT_OPTION = -o $@
<%marker(macros)%>

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

<%if(custom_types)%>
<%foreach(custom_types)%>
<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
GENERATED_DIRTY +=<%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%>
<%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(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> $^ <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%>

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

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

$(BIN): $(OBJS)
	$(LINK.cc) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)

<%endif%>
<%if(sharedname)%>
all: $(SHLIB) <%if(install)%>install<%endif%>

$(SHLIB): $(OBJS)
	$(LINK.cc) $(SHFLAGS) $(OUTPUT_OPTION) $(OBJS) $(LDLIBS)

<%endif%>
<%if(staticname)%>
$(LIB): $(OBJS)
	$(AR) $(ARFLAGS) $(LIB) $(OBJS)

<%endif%>
%.o: %.cpp
	$(COMPILE.cc) $< $(OUTPUT_OPTION)

<%if(install)%>
<%if(exename)%>
INSTARGET = $(BIN)
<%else%>
<%if(sharedname)%>
INSTARGET = $(SHLIB)
<%else%>
<%if(staticname)%>
INSTARGET = $(LIB)
<%endif%>
<%endif%>
<%endif%>
install:
	@echo "Installing $(INSTARGET) -> <%install%>/$(INSTARGET)"
	@mkdir -p "<%install%>"
	@$(RM) "<%install%>/$(INSTARGET)"
	@ln -s "$(PWD)/$(INSTARGET)" "<%install%>"

<%endif%>
clean:
	-$(RM) $(OBJS)

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

#----------------------------------------------------------------------------
#       Dependencies
#----------------------------------------------------------------------------
<%marker(bottom)%>