1##  $Id: Makefile 9794 2015-03-17 20:49:15Z iulius $
2##
3##  Currently just handles creation of the automatically generated header
4##  files.  Eventually, rules for installing INN's header files will go
5##  here.
6
7include ../Makefile.global
8
9top	      = ..
10
11ALL	      = inn/portable-getaddrinfo.h inn/portable-getnameinfo.h \
12		inn/portable-macros.h inn/portable-socket.h \
13		inn/portable-stdbool.h inn/system.h inn/version.h
14
15EXTRA	      = config.h inn/paths.h
16
17all: $(ALL) $(EXTRA)
18
19warnings: all
20
21bootstrap:
22
23clean:
24	rm -f $(ALL)
25
26clobber distclean maintclean: clean
27	rm -f $(EXTRA)
28
29depend:
30
31profiled: all
32
33$(EXTRA) $(FIXSCRIPT):
34	@echo Run configure before running make.  See INSTALL for details.
35	@exit 1
36
37
38##  Build rules.
39
40inn/portable-getaddrinfo.h: portable/getaddrinfo.h
41	$(SED) 's/"portable\//"inn\/portable-/g' portable/getaddrinfo.h \
42	  | $(SED) -e 's/"config\.h"/<inn\/defines.h>/g' \
43	  > inn/portable-getaddrinfo.h
44
45inn/portable-getnameinfo.h: portable/getnameinfo.h
46	$(SED) 's/"portable\//"inn\/portable-/g' portable/getnameinfo.h \
47	  | $(SED) -e 's/"config\.h"/<inn\/defines.h>/g' \
48	  > inn/portable-getnameinfo.h
49
50inn/portable-macros.h: portable/macros.h
51	$(SED) 's/"portable\//"inn\/portable-/g' portable/macros.h \
52	  > inn/portable-macros.h
53
54inn/portable-socket.h: portable/socket.h
55	$(SED) 's/"portable\//"inn\/portable-/g' portable/socket.h \
56	  | $(SED) -e 's/HAVE_INET6/INN_HAVE_INET6/g' \
57	           -e 's/"config\.h"/<inn\/defines.h>/g' \
58	  > inn/portable-socket.h
59
60inn/portable-stdbool.h: portable/stdbool.h
61	$(SED) 's/"portable\//"inn\/portable-/g' portable/stdbool.h \
62	  | $(SED) -e 's/HAVE__BOOL/INN_HAVE__BOOL/g' \
63	           -e 's/HAVE_STDBOOL_H/INN_HAVE_STDBOOL_H/g' \
64	           -e 's/"config\.h"/<inn\/defines.h>/g' \
65	  > inn/portable-stdbool.h
66
67inn/system.h: config.h $(top)/support/mksystem
68	$(top)/support/mksystem $(AWK) config.h > $@
69
70inn/version.h: $(top)/support/mkversion $(top)/Makefile.global
71	$(top)/support/mkversion '$(VERSION)' '$(VERSION_EXTRA)' > $@
72
73
74##  Installation rules.
75
76install:
77	$(top)/support/install-sh $(OWNER) -m 0755 -d $D$(PATHINCLUDE)/inn
78	for F in inn/*.h ; do \
79	    $(CP_RPUB) $$F $D$(PATHINCLUDE)/$$F ; \
80	done
81