# -*- makefile -*- # Commom Makefile macros VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS += @CFEXTRA@ @CFLAGS@ @DEFS@ CFNUBS = @CFNUBS@ LDFLAGS += @LDFLAGS@ LDLIBS += @LIBS@ CFLAGS += -I../common/ LDFLAGS += -L../common/ TESTD = ../fixtures TESTX = ../test PYTHON = @PYTHON@ BASH = @BASH@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_DIR = @INSTALL@ -d GGO = @GGO@ XML2C = @XML2C@ GPERF = @GPERF@ XSLTP = @XSLTP@ WITH_UNIT = @WITH_UNIT@ WITH_ACCEPT = @WITH_ACCEPT@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ datarootdir = @datarootdir@ localedir = @localedir@ RUBBISH += *~ # acceptance tests, pass the program name and relative # testexec path (where test scripts are kept) accept : if [ -e accept.sh ] ; then \ $(BASH) accept.sh $(NAME) $(TESTX) $(TESTD) ; \ fi .PHONY : accept # generate .c files from .gperf ifneq (no,$(GPERF)) %.c : %.gperf $(GPERF) \ --delimiters "," \ --struct-type \ --language ANSI-C \ --lookup-function-name $*_lookup \ --ignore-case \ --readonly-tables \ --enum \ --output-file $@ $< endif # generate options code from .ggo ifneq (no,$(GGO)) %.h %.c : %.ggo $(GGO) -u -i $< -f $* -F $* main.o : main.c options.h endif .SECONDARY : options.c options.h options.o : options.c options.h $(CC) $(CFLAGS) $(CFNUBS) -c -o $@ $< # generate manpages from docbook source, the location # of the xsl is as used by Debian/Ubuntu ifneq (no,$(XSLTP)) MANXSL = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl %.1 : %.xml ../docbook $(XSLTP) --xinclude $(MANXSL) $< endif