summaryrefslogtreecommitdiff
path: root/bin/MakeProjectCreator/templates/make.mpd
blob: 219b65c13eca6191e47e5c187728c7be24ba4320 (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
#----------------------------------------------------------------------------
#       Macros
#----------------------------------------------------------------------------
<%marker(top)%>
SOEXT         = so
MAKEFILE      = <%project_file%>
<%if(exename)%>
BIN           = <%exename%>
<%endif%>
<%if(staticname)%>
LIB           = lib<%staticname%>.a
<%endif%>
<%if(sharedname)%>
SHLIB         = lib<%sharedname%>.$(SOEXT)
CPPFLAGS     += -KPIC
<%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%>
<%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%>
SHFLAGS       = -G
OUTPUT_OPTION = -o $@
<%marker(macros)%>

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

<%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%>

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