summaryrefslogtreecommitdiff
path: root/src/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile177
1 files changed, 177 insertions, 0 deletions
diff --git a/src/makefile b/src/makefile
new file mode 100644
index 0000000..09670b2
--- /dev/null
+++ b/src/makefile
@@ -0,0 +1,177 @@
1 #########################################################################
2 #
3 # HTCd - Copyright (C) 1998-2006 Henrik Rydberg
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #
19
20LIBRARY = libhtc.a
21INSTALL = ../bin
22
23############################################################################
24
25MODULE += mt
26mt_c = test
27mt_o = cfind crfind strip \
28 sfind srfind sfindtab srfindtab scomptab sconvert \
29 find_of rfind_of find_not_of rfind_not_of skip_parentesis \
30 stringref mstream mread mstring mset msmap \
31 random dates lock lookup issue config
32
33
34MODULE += mime
35mime_c = test
36mime_o = mime def mailbox base64 qp pack
37
38
39MODULE += mail
40mail_c = inbox move list
41
42
43MODULE += http
44http_c = test
45http_o = mime req resp
46
47
48MODULE += ops
49ops_c = test
50ops_o = operator express basic comp string latex
51
52
53MODULE += hdb
54hdb_c = test hdbtest hdbcvt hdbfix
55hdb_o = filemap sortable db comp cvt
56
57
58MODULE += hed
59hed_c = test hed
60hed_o = input edit tables
61hed_x = hed
62
63
64MODULE += lang
65lang_c = test
66lang_o = token env parse ops basic func latex help flow db lang
67
68
69MODULE += sh
70sh_c = htc
71sh_o = file convert dates user tree sys net main
72sh_x = htc
73
74MODULE += serv
75serv_c = htcs
76serv_o = direct request const auth form tempmap main
77serv_x = htcs
78
79MODULE += net
80net_c = test htcd redirect route80
81net_o = isocket server thrserv
82net_x = htcd redirect
83
84MODULE += labat
85labat_c = atomlab
86labat_f = labat
87labat_o = resten deriv grad grabgr laplac laplac2 ggaexc \
88 exchen ldaec gcor ggaec ggauxc exchpt ldauc \
89 ggauc spline splint
90labat_x = atomlab labat
91
92############################################################################
93
94CTARGET = $(foreach mod,$(MODULE),\
95 $(addprefix $(mod)/,$($(mod)_c)))
96
97FTARGET = $(foreach mod,$(MODULE),\
98 $(addprefix $(mod)/,$($(mod)_f)))
99
100LTARGET = $(foreach mod,$(MODULE),\
101 $(addprefix $(mod)/,$($(mod)_o)))
102
103XTARGET = $(foreach mod,$(MODULE),\
104 $(addprefix $(mod)/,$($(mod)_x)))
105
106XLIST = $(foreach mod,$(MODULE),$($(mod)_x))
107
108CTARG = $(addprefix tmp/bin/,$(CTARGET))
109FTARG = $(addprefix tmp/bin/,$(FTARGET))
110XTARG = $(addprefix tmp/bin/,$(XTARGET))
111COBJ = $(addprefix tmp/obj/c/,$(addsuffix .o,$(CTARGET)))
112FOBJ = $(addprefix tmp/obj/f/,$(addsuffix .o,$(FTARGET)))
113LOBJ = $(addprefix tmp/obj/l/,$(addsuffix .o,$(LTARGET)))
114TLIB = $(addprefix tmp/obj/,$(LIBRARY))
115
116############################################################################
117
118INCLUDE = -I.
119COPT = -O3 -pthread
120FOPT = -O5
121CLIBS = -lncurses
122FLIBS =
123
124.PHONY: all man html clean mkobj install
125.PRECIOUS: tmp/obj/c/%.o tmp/obj/f/%.o tmp/obj/l/%.o
126
127############################################################################
128
129all: $(LOBJ) $(TLIB) $(FOBJ) $(COBJ) $(FTARG) $(CTARG)
130
131tmp/bin/%: tmp/obj/c/%.o $(TLIB)
132 @mkdir -p $(@D)
133 g++ $(COPT) $< $(TLIB) $(CLIBS) -o $@
134
135tmp/bin/%: tmp/obj/f/%.o $(TLIB)
136 @mkdir -p $(@D)
137 f77 $(FOPT) $< $(TLIB) $(FLIBS) -o $@
138
139tmp/obj/c/%.o: %.cc
140 @mkdir -p $(@D)
141 gcc $(INCLUDE) $(COPT) -c $< -o $@
142
143tmp/obj/f/%.o: %.f
144 @mkdir -p $(@D)
145 f77 $(FOPT) -c $< -o $@
146
147$(TLIB): $(LOBJ)
148 @rm -f $(TLIB)
149 ar qc $(TLIB) $(LOBJ)
150
151tmp/obj/l/%.o: %.cc
152 @mkdir -p $(@D)
153 gcc $(INCLUDE) $(COPT) -c $< -o $@
154
155tmp/obj/l/%.o: %.f
156 @mkdir -p $(@D)
157 f77 $(FOPT) -c $< -o $@
158
159man:
160 @rm -rf tmp/man
161 doxygen etc/doxman
162
163html:
164 @rm -rf tmp/html
165 doxygen etc/doxhtml
166
167install: $(XTARG)
168 @mkdir -p $(INSTALL)
169 cp -rfp $(XTARG) $(INSTALL)
170
171clean:
172 rm -rf tmp
173
174distclean:
175 rm -rf tmp; cd $(INSTALL); rm -rf $(XLIST)
176
177############################################################################