1##  $Id: Makefile 10423 2020-11-22 21:15:35Z iulius $
2
3include ../Makefile.global
4
5# This version number should be increased with every change to the library
6# source following the rules laid out in the libtool manual.  This will also
7# force the file name of the shared library to change so that one can
8# recover from make update.  We can't use .OLD extensions for the shared
9# library since ldconfig will think .OLD sorts after the regular library and
10# will point the binaries at the old library.
11LTVERSION     = 3:4:0
12
13top           = ..
14CFLAGS        = $(GCFLAGS) -I.
15
16SOURCES       = his.c hismethods.c $(METHOD_SOURCES)
17OBJECTS       = $(SOURCES:.c=.o)
18LOBJECTS      = $(OBJECTS:.o=.lo)
19
20.SUFFIXES: .lo
21
22all: library programs
23
24# Included here after the all target, since additional rules are defined in
25# Make.methods to be sure that we recurse properly to build the methods.
26include Make.methods
27
28warnings:
29	$(MAKE) COPT='$(WARNINGS)' all
30
31install: all
32	$(LI_LPUB) libinnhist.$(EXTLIB) $D$(PATHLIB)/libinnhist.$(EXTLIB)
33
34bootstrap: Make.methods
35
36library: libinnhist.$(EXTLIB)
37
38programs: $(PROGRAMS)
39
40clean clobber distclean:
41	rm -f *.o *.lo */*.o */*.lo libinnhist.la libinnhist.a
42	rm -f libinnhist_pure_*.a .pure $(PROGRAMS)
43	rm -f buildconfig profiled libinnhist$(PROFSUFFIX).a
44	rm -rf .libs */.libs
45
46maintclean: distclean
47	rm -f Make.methods hismethods.c hismethods.h
48
49$(FIXSCRIPT):
50	@echo Run configure before running make.  See INSTALL for details.
51	@exit 1
52
53libinnhist.la: $(OBJECTS) $(LIBSTORAGE) $(LIBINN)
54	$(LIBLD) $(LDFLAGS) -o $@ $(LOBJECTS) \
55	    $(LIBSTORAGE) $(LIBINN) $(STORAGE_LIBS) $(LIBS) \
56	    -rpath $(PATHLIB) -version-info $(LTVERSION)
57
58libinnhist.a: $(OBJECTS)
59	ar r $@ $(OBJECTS)
60	$(RANLIB) libinnhist.a
61
62# Try to set up these rules so that buildconfig is only run once.
63# Make.methods is included in the distribution tarball since some non-GNU
64# makes can't deal with including a non-existent file, so don't depend on
65# it.  The dependencies aren't entirely accurate; you really want to re-run
66# buildconfig each time a new subdirectory is added to the directory.  But
67# adding a dependency on . is a bit too non-portable for my taste and causes
68# too many rebuilds.
69Make.methods hismethods.h hismethods.c: buildconfig
70	./buildconfig
71
72buildconfig: buildconfig.in $(FIXSCRIPT)
73	$(FIXSCRIPT) -i buildconfig.in
74
75.c.o .c.lo:
76	$(LIBCC) $(CFLAGS) $(CCOUTPUT)
77
78$(LIBINN):      ; (cd ../lib ; $(MAKE))
79$(LIBSTORAGE):	; (cd ../storage ; $(MAKE) library)
80
81
82##  Profiling.  The rules are a bit brute-force, but good enough.
83
84profiled: libinnhist$(PROFSUFFIX).a
85	date >$@
86
87libinnhist$(PROFSUFFIX).a: $(SOURCES)
88	rm -f $(OBJECTS)
89	$(MAKEPROFILING) libinnhist.a
90	mv libinnhist.a libinnhist$(PROFSUFFIX).a
91	$(RANLIB) libinnhist$(PROFSUFFIX).a
92	rm -f $(OBJECTS)
93
94
95##  Dependencies.  Default list, below, is probably good enough.
96
97depend:	$(SOURCES) $(EXTRA_SOURCES)
98	$(MAKEDEPEND) '$(CFLAGS)' $(SOURCES) $(EXTRA_SOURCES)
99
100# DO NOT DELETE THIS LINE -- make depend depends on it.
101his.o: his.c ../include/config.h ../include/inn/defines.h \
102  ../include/inn/system.h ../include/inn/macros.h \
103  ../include/inn/portable-macros.h ../include/inn/portable-stdbool.h \
104  ../include/inn/defines.h ../include/inn/options.h ../include/clibrary.h \
105  ../include/config.h ../include/inn/macros.h \
106  ../include/portable/stdbool.h ../include/inn/history.h \
107  ../include/inn/messages.h ../include/inn/timer.h ../include/inn/libinn.h \
108  ../include/inn/concat.h ../include/inn/xmalloc.h ../include/inn/xwrite.h \
109  ../include/inn/storage.h ../include/inn/options.h hisinterface.h \
110  hismethods.h
111hismethods.o: hismethods.c hisinterface.h ../include/config.h \
112  ../include/inn/defines.h ../include/inn/system.h ../include/inn/macros.h \
113  ../include/inn/portable-macros.h ../include/inn/portable-stdbool.h \
114  ../include/inn/defines.h ../include/inn/options.h hismethods.h \
115  hisv6/hisv6.h
116hisv6/hisv6.o: hisv6/hisv6.c ../include/config.h ../include/inn/defines.h \
117  ../include/inn/system.h ../include/inn/macros.h \
118  ../include/inn/portable-macros.h ../include/inn/portable-stdbool.h \
119  ../include/inn/defines.h ../include/inn/options.h ../include/clibrary.h \
120  ../include/config.h ../include/inn/macros.h \
121  ../include/portable/stdbool.h hisinterface.h hisv6/hisv6.h \
122  hisv6/hisv6-private.h ../include/inn/history.h ../include/inn/storage.h \
123  ../include/inn/options.h ../include/inn/libinn.h ../include/inn/concat.h \
124  ../include/inn/xmalloc.h ../include/inn/xwrite.h ../include/inn/dbz.h \
125  ../include/inn/fdflag.h ../include/inn/portable-socket.h \
126  ../include/inn/portable-getaddrinfo.h \
127  ../include/inn/portable-getnameinfo.h ../include/inn/innconf.h \
128  ../include/inn/timer.h ../include/inn/qio.h ../include/inn/sequence.h \
129  ../include/inn/inndcomm.h
130