diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-11-06 17:09:44 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-11-12 19:41:13 +0100 |
commit | 5fa8e494ca240567313215a7d5a87c620e86024e (patch) | |
tree | fa83c029ead4e61120bd670125d6ec50765fc4c9 /Makefile.rules.in | |
parent | f858f20abb8e6b6881d4c343b737a09697c95779 (diff) |
build: autotools conversion
1) This removes former Makefiles and install-sh (which is now
automagically imported via autoreconf).
Makefile.defs.in
Makefile.in
Makefile.rules.in
src/Makefile.in
install-sh (now automagically imported via autoreconf).
2) CFLAGS are left almost same, they are integrated into Make_global.am.
Use AM_CPPFLAGS to set the CFLAGS set by pkgconfig.
3) Add m4 directory to the tree which only contains the .gitignore
file. Update .gitignore file to skip autogenerated files.
4) include <config.h> whenever required.
5) Minor adjustments to scanner.l and parser_bison.y to compile cleanly
with autotools.
6) Add %option outfile=lex.yy.c to scanner.l, otherwise I hit this error
here:
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -DDEFAULT_INCLUDE_PATH="\"/usr/etc\"" -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wsign-compare -Winit-self -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute -Wcast-align -Wundef -Wbad-function-cast -g -O2 -MT mnl.o -MD -MP -MF $depbase.Tpo -c -o mnl.o mnl.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/sh ../build-aux/ylwrap scanner.l lex.yy.c scanner.c -- flex
make[3]: *** [scanner.c] Error 1
make[3]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pablo/devel/scm/git-netfilter/nftables'
make: *** [all] Error 2
7) Add Makefile.am for include/ (contributed by Giorgio Dal Molin).
The doc/ and files/ conversion to automake will come in follow up
patches but 'make distcheck' already works.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'Makefile.rules.in')
-rw-r--r-- | Makefile.rules.in | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/Makefile.rules.in b/Makefile.rules.in deleted file mode 100644 index 6a009161..00000000 --- a/Makefile.rules.in +++ /dev/null @@ -1,96 +0,0 @@ -include Makefile.defs - -makedeps += $(SUBDIR)Makefile -makedeps += Makefile -makedeps += Makefile.defs -makedeps += Makefile.rules - -configure: configure.ac - sh autogen.sh - -%: %.in configure - sh configure - -%.o: %.c $(makedeps) - @echo -e " CC\t\t$<" - $(CC) $(CFLAGS) -c -o $@ $< - -.%.d: %.c $(makedeps) - @echo -e " DEP\t\t$<" - $(RM) $@ - $(CC) -M $(CFLAGS) $< | sed 's,$(*F)\.o[ :]*,$*.o $@ : ,g' > $@ - -%.c %.h: %.y $(makedeps) - @echo -e " YACC\t\t$<" - $(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $< - ( \ - echo "#ifndef __$(*F)_H"; \ - echo "#define __$(*F)_H"; \ - cat $*.h.tmp; \ - echo "#endif /* __$(*F)_H */" \ - ) > $*.h - $(RM) $*.h.tmp - -%.c %.h: %.l $(makedeps) - @echo -e " LEX\t\t$<" - $(LEX) -t --header-file=$(<:.l=.h) $< > $@ - -%.8: %.xml $(makedeps) - @echo -e " MAN\t\t$@" - (cd $(SUBDIR); $(DB2MAN) --xinclude ../$<) - -%.pdf: %.xml $(makedeps) - @echo -e " PDF\t\t$@" - dblatex -q -t pdf -o $@ $< - -archive: - git archive --prefix=nftables-@PACKAGE_VERSION@/ HEAD | \ - bzip2 -c > nftables-@PACKAGE_VERSION@.tar.bz2 - -define program_template -$(1)-obj := $$(patsubst %,$(SUBDIR)%,$$($(1)-obj)) -$(1)-extra-clean-files := $$(patsubst %,$(SUBDIR)%,$$($(1)-extra-clean-files)) - -depfiles := $$(patsubst $(SUBDIR)%.o,$(SUBDIR).%.d,$$($(1)-obj)) - -$(SUBDIR)$(1): $$($(1)-extra-targets) $$($(1)-obj) - @echo -e " LD\t\t$$@" - $$(CC) $$($(1)-obj) $$(LDFLAGS) -o $$@ -all_targets += $(SUBDIR)$(1) - -.PHONY: $(1)-clean -$(1)-clean: - @echo -e " CLEAN\t\t$(1)" - $$(RM) $$($(1)-obj) $$(depfiles) $$($(1)-extra-clean-files) $(SUBDIR)$(1) -clean_targets += $(1)-clean - -.PHONY: $(1)-install -$(1)-install: - @echo -e " INSTALL\t$1" - $(MKDIR_P) $$(DESTDIR)/$$($(1)-destdir) - $(INSTALL) -m 755 -p \ - $(SUBDIR)$(1) \ - $$(DESTDIR)/$$($(1)-destdir)/$(1) -install_targets += $(1)-install - -ifneq ($(MAKECMDGOALS),clean) --include $$(depfiles) -endif -endef - -ifneq ($(SUBDIR),) -include $(SUBDIR)/Makefile -$(foreach prog,$(PROGRAMS),$(eval $(call program_template,$(prog)))) -endif - -.DEFAULT_GOAL := all - -.PHONY: all clean install -all: $(SUBDIRS) $(all_targets) -clean: $(SUBDIRS) $(clean_targets) -install: all $(SUBDIRS) $(install_targets) - -.PHONY: $(SUBDIRS) -$(SUBDIRS): - @echo -e " SUBDIR\t$@/" - @$(MAKE) -s -f Makefile.rules $(MAKECMDGOALS) SUBDIR="$@/" SUBDIRS="" |