diff options
author | Rob Austein <sra@hactrn.net> | 2011-06-23 06:08:13 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-06-23 06:08:13 +0000 |
commit | af52b802a56d025227a6685b2061ce3748ea8ce8 (patch) | |
tree | 3cddfc55642705dca357f9387ecb160bc02f0264 | |
parent | a2e3948e29fe960c94391d77118c37c2edc6be76 (diff) |
Pick stack names out of C source
svn path=/rcynic-ng/Makefile.in; revision=3895
-rw-r--r-- | rcynic-ng/Makefile.in | 12 | ||||
-rw-r--r-- | rcynic-ng/defstack.awk | 16 |
2 files changed, 15 insertions, 13 deletions
diff --git a/rcynic-ng/Makefile.in b/rcynic-ng/Makefile.in index 31ebbcb5..9e79103b 100644 --- a/rcynic-ng/Makefile.in +++ b/rcynic-ng/Makefile.in @@ -6,8 +6,8 @@ BIN = ${NAME} SRC = ${NAME}.c OBJ = ${NAME}.o +HDR = defasn1.h GEN = defstack.h -HDR = defasn1.h ${GEN} CFLAGS = @CFLAGS@ -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror-implicit-function-declaration LDFLAGS = @LDFLAGS@ @LD_STATIC_FLAG@ @@ -26,11 +26,11 @@ clean: cd static-rsync; ${MAKE} $@ rm -f ${BIN} ${OBJ} ${GEN} -${BIN}: ${SRC} ${HDR} +${BIN}: ${SRC} ${HDR} ${GEN} ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} ${LIBS} -defstack.h: defstack.awk - ${AWK} -f >$@ defstack.awk +defstack.h: defstack.awk ${SRC} ${HDR} + ${AWK} -f >$@ defstack.awk ${SRC} ${HDR} test: ${BIN} if test -r rcynic.conf; then ./${BIN} -j 0 && echo && ./show.sh; else echo No rcynic.conf, skipping test; fi @@ -47,8 +47,8 @@ distclean: clean docclean tags: TAGS -TAGS: ${SRC} ${HDR} - etags ${SRC} ${HDR} +TAGS: ${SRC} ${HDR} ${GEN} + etags ${SRC} ${HDR} ${GEN} # Doc stuff right now is just internals doc, of interest only to # programmers. Real doc for rcynic is still the README. This may diff --git a/rcynic-ng/defstack.awk b/rcynic-ng/defstack.awk index 66882440..4593cb33 100644 --- a/rcynic-ng/defstack.awk +++ b/rcynic-ng/defstack.awk @@ -58,12 +58,14 @@ BEGIN { print "#ifndef __DEFSTACK_H__"; print "#define __DEFSTACK_H__"; print ""; - define_stack("HOST_MIB_COUNTER"); - define_stack("VALIDATION_STATUS"); - define_stack("FileAndHash"); - define_stack("ROAIPAddress"); - define_stack("ROAIPAddressFamily"); - define_stack("walk_ctx_t"); - define_stack("rsync_ctx_t"); +} + +/DECLARE_STACK_OF/ { + sub(/^[ \t]+/, ""); + if (split($0, a, /[() \t]+/) > 1 && a[1] == "DECLARE_STACK_OF") + define_stack(a[2]); +} + +END { print "#endif /* __DEFSTACK_H__ */"; } |