forked from pivasoftware/microxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
304 lines (237 loc) · 7.01 KB
/
Makefile.in
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#
# Makefile for microxml, a micro XML-like file parsing library.
#
# Copyright 2003-2011 by Michael R Sweet.
# Copyright 2011-2012 by Luka Perkov.
#
# These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and Luka Perkov. They are protected by
# Federal copyright law. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file.
# If this file is missing or damaged, see the license at:
#
# http://www.minixml.org/
#
#
# Compiler tools definitions...
#
AR = @AR@
ARFLAGS = @ARFLAGS@
ARCHFLAGS = @ARCHFLAGS@
CC = @CC@
CFLAGS = $(OPTIM) $(ARCHFLAGS) @CFLAGS@ @CPPFLAGS@ @PTHREAD_FLAGS@
CP = @CP@
DSO = @DSO@
DSOFLAGS = @DSOFLAGS@
LDFLAGS = $(OPTIM) $(ARCHFLAGS) @LDFLAGS@
INSTALL = @INSTALL@
LIBMICROXML_SHARED = @LIBMICROXML_SHARED@
LIBMICROXML_STATIC = @LIBMICROXML_STATIC@
LIBS = @LIBS@ @PTHREAD_LIBS@
LN = @LN@ -s
MKDIR = @MKDIR@
OPTIM = @OPTIM@
RANLIB = @RANLIB@
RM = @RM@ -f
SHELL = /bin/sh
#
# Configured directories...
#
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datarootdir = @datarootdir@
includedir = @includedir@
libdir = @libdir@
BUILDROOT = $(DSTROOT)
DSTROOT = $(DESTDIR)
#
# Install commands...
#
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755 -s
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -d
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755
INSTALL_MAN = $(INSTALL) -m 644
INSTALL_SCRIPT = $(INSTALL) -m 755
#
# Rules...
#
.SILENT:
.SUFFIXES: .c .o
.c.o:
echo Compiling $<
$(CC) $(CFLAGS) -c -o $@ $<
#
# Targets...
#
PUBLIBOBJS = mxml-attr.o mxml-entity.o mxml-file.o mxml-get.o \
mxml-index.o mxml-node.o mxml-search.o mxml-set.o
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
TARGETS = $(LIBMICROXML_SHARED) $(LIBMICROXML_STATIC)
#
# Make everything...
#
all: Makefile config.h $(TARGETS)
#
# Clean everything...
#
clean:
echo Cleaning build files...
$(RM) $(OBJS) $(TARGETS) $(LIBOBJS)
$(RM) libmicroxml.a libmicroxml.so.1.0 libmicroxml.so.1 libmicroxml.so libmicroxml.sl.1 libmicroxml.1.dylib
#
# Really clean everything...
#
distclean: clean
echo Cleaning distribution files...
$(RM) config.cache config.log config.status
$(RM) Makefile config.h microxml.list microxml.pc
$(RM) -r autom4te*.cache
$(RM) *.bck *.bak
$(RM) -r clang
#
# Run the clang.llvm.org static code analysis tool on the C sources.
#
.PHONY: clang clang-changes
clang:
echo Doing static code analysis of all code using CLANG...
$(RM) -r clang
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes:
echo Doing static code analysis of changed code using CLANG...
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
#
# Install everything...
#
install: $(TARGETS) install-$(LIBMICROXML_SHARED) install-$(LIBMICROXML_STATIC)
echo Installing header files in $(BUILDROOT)$(includedir)...
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
$(INSTALL_DATA) microxml.h $(BUILDROOT)$(includedir)
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) microxml.pc $(BUILDROOT)$(libdir)/pkgconfig
install-:
install-libmicroxml.a:
echo Installing libmicroxml.a to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmicroxml.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmicroxml.a
install-libmicroxml.so.1.0:
echo Installing libmicroxml.so to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmicroxml.so.1.0 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so
$(LN) libmicroxml.so.1.0 $(BUILDROOT)$(libdir)/libmicroxml.so
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so.1
$(LN) libmicroxml.so.1.o $(BUILDROOT)$(libdir)/libmicroxml.so.1
install-libmicroxml.sl.1:
echo Installing libmicroxml.sl to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmicroxml.sl.1 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so
$(LN) libmicroxml.sl.1 $(BUILDROOT)$(libdir)/libmicroxml.sl
install-libmicroxml.1.dylib:
echo Installing libmicroxml.dylib to $(BUILDROOT)$(libdir)...
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmicroxml.1.dylib $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.dylib
$(LN) libmicroxml.1.dylib $(BUILDROOT)$(libdir)/libmicroxml.dylib
#
# Uninstall everything...
#
uninstall: uninstall-$(LIBMICROXML_SHARED) uninstall-$(LIBMICROXML_STATIC)
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
$(RM) $(BUILDROOT)$(includedir)/microxml.h
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/microxml.pc
uninstall-:
uninstall-libmicroxml.a:
echo Uninstalling libmicroxml.a from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.a
uninstall-libmicroxml.so.1.0:
echo Uninstalling libmicroxml.so from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so.1
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.so.1.0
uninstall-libmicroxml.sl.1:
echo Uninstalling libmicroxml.sl from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.sl
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.sl.1
uninstall-libmicroxml.1.dylib:
echo Uninstalling libmicroxml.dylib from $(BUILDROOT)$(libdir)...
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.dylib
$(RM) $(BUILDROOT)$(libdir)/libmicroxml.1.dylib
#
# autoconf stuff...
#
Makefile: configure Makefile.in
echo Updating makefile...
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
else \
./configure; \
fi
touch config.h
config.h: configure config.h.in
echo Updating config.h...
autoconf
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
else \
./configure; \
fi
touch config.h
#
# Figure out lines-of-code...
#
.PHONY: sloc
sloc:
echo "libmicroxml: \c"
sloccount $(LIBOBJS:.o=.c) microxml-private.c microxml.h 2>/dev/null | \
grep "Total Physical" | awk '{print $$9}'
#
# libmicroxml.a
#
libmicroxml.a: $(LIBOBJS)
echo Creating $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
$(LIBOBJS): microxml.h
mxml-entity.o mxml-file.o mxml-private.o: mxml-private.h
#
# libmicroxml.so.1.0
#
libmicroxml.so.1.0: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmicroxml.so.1.0 $(LIBOBJS)
$(RM) libmicroxml.so libmicroxml.so.1
$(LN) libmicroxml.so.1.0 libmicroxml.so
$(LN) libmicroxml.so.1.0 libmicroxml.so.1
#
# libmicroxml.sl.1
#
libmicroxml.sl.1: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmicroxml.sl.1 $(LIBOBJS)
$(RM) libmicroxml.sl
$(LN) libmicroxml.sl.1 libmicroxml.sl
#
# libmicroxml.1.dylib
#
libmicroxml.1.dylib: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libmicroxml.1.dylib \
-install_name $(libdir)/libmicroxml.dylib \
-current_version 1.0.0 \
-compatibility_version 1.0.0 \
$(LIBOBJS)
$(RM) libmicroxml.dylib
$(LN) libmicroxml.1.dylib libmicroxml.dylib
#
# All object files depend on the makefile...
#
$(OBJS): Makefile config.h