Skip to content
This repository was archived by the owner on Jun 6, 2021. It is now read-only.

Commit f39628f

Browse files
committed
buildsys: move mkhooktypes to include build phase, as well as serno.h generation
1 parent 7adad7b commit f39628f

File tree

5 files changed

+12
-26
lines changed

5 files changed

+12
-26
lines changed

Makefile

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@ DISTCLEAN = extra.mk buildsys.mk config.log config.status atheme-services.pc
66
-include buildsys.mk
77

88
# explicit dependencies need to be expressed to ensure parallel builds don't die
9-
pre-recurse: include/serno.h include/hooktypes.h
10-
pre-depend: pre-recurse
11-
libathemecore: $(LIBMOWGLI)
9+
libathemecore: include $(LIBMOWGLI)
1210
modules: libathemecore
1311
src: libathemecore
1412

15-
include/serno.h:
16-
@revh=; \
17-
if [ -d .git ]; then \
18-
revh=`git log -1 --pretty=oneline | cut -d' ' -f1 2>/dev/null` || :; \
19-
fi; \
20-
if [ -z "$$revh" ] && [ ! -r include/serno.h ]; then \
21-
revh=`sed -ne 's/^node: \(............\).*/\1/p' .hg_archival.txt 2>/dev/null` || :; \
22-
[ -n "$$revh" ] || revh=unknown; \
23-
fi; \
24-
[ -z "$$revh" ] || echo "#define SERNO \"$$revh\"" >include/serno.h
25-
2613
install-extra:
2714
@echo "----------------------------------------------------------------"
2815
@echo ">>> Remember to cd to ${prefix} and edit your config file.";
@@ -57,9 +44,6 @@ dist:
5744
hg manifest | awk '{ print "$(DISTNAME)/"$$1; } END { print "$(DISTNAME)/configure"; print "$(DISTNAME)/aclocal.m4"; print "$(DISTNAME)/include/sysconf.h.in"; print "$(DISTNAME)/include/serno.h"; }' | $(TAR) -chnzf $(DISTNAME).tar.gz -T /dev/stdin
5845
$(RM) $(DISTNAME)
5946

60-
include/hooktypes.h: ${SRCDIR}/libathemecore/mkhooktypes.sh ${SRCDIR}/libathemecore/hooktypes.in
61-
(cd libathemecore && touch .depend && ${MAKE} ../include/hooktypes.h)
62-
6347
buildsys.mk:
6448
@echo "Run ./configure first you idiot."
6549
@exit 1

include/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ include ../extra.mk
22

33
SUBDIRS = inline protocol
44

5-
DISTCLEAN = serno.h
5+
DISTCLEAN = hooktypes.h serno.h
6+
pre-depend: ${DISTCLEAN}
67

78
INCLUDES = \
89
abirev.h \
@@ -58,4 +59,13 @@ INCLUDES = \
5859
uplink.h \
5960
users.h
6061

62+
hooktypes.h:
63+
$(info Generate: $@)
64+
@sh mkhooktypes.sh hooktypes.in >hooktypes.h
65+
66+
serno.h:
67+
$(info Generate: $@)
68+
@revh=`git log -1 --pretty=oneline | cut -d' ' -f1 2>/dev/null` || :; \
69+
[ -z "$$revh" ] || echo "#define SERNO \"$$revh\"" >serno.h
70+
6171
include ../buildsys.mk
File renamed without changes.
File renamed without changes.

libathemecore/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,9 @@ SRCS = ${BASE_SRCS} version.c
6565
include ../buildsys.mk
6666
include ../extra.mk
6767

68-
.c.c.dep: ../include/hooktypes.h ../include/serno.h
69-
7068
CPPFLAGS += $(MOWGLI_CFLAGS) $(PCRE_CFLAGS) -I../include -DBINDIR=\"$(bindir)\"
7169
CFLAGS += $(LIB_CFLAGS)
7270
LIBS += $(MOWGLI_LIBS) $(PCRE_LIBS) $(LIBINTL)
7371
LDFLAGS += $(LDFLAGS_RPATH)
7472

7573
build: depend all
76-
77-
../include/hooktypes.h: mkhooktypes.sh hooktypes.in
78-
sh mkhooktypes.sh hooktypes.in >../include/hooktypes.h
79-
80-
../include/serno.h:
81-
(cd ..; ${MAKE} include/serno.h)

0 commit comments

Comments
 (0)