1 #!/usr/bin/make -f 2 # pnglibconf.mak - standard make lines for pnglibconf.h 3 # 4 # These lines are copied from Makefile.am, they illustrate 5 # how to automate the build of pnglibconf.h from scripts/pnglibconf.dfa 6 # given just 'awk', a C preprocessor and standard command line utilities 7 8 # Override as appropriate, these definitions can be overridden on 9 # the make command line (AWK='nawk' for example). 10 AWK = gawk 11 AWK = mawk 12 AWK = nawk 13 AWK = one-true-awk 14 AWK = awk # Crashes on SunOS 5.10 - use 'nawk' 15 CPP = $(CC) -E # On SUN OS 5.10 if this causes problems use /lib/cpp 16 17 MOVE = mv 18 DELETE = rm -f 19 ECHO = echo 20 DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa. Eg: 21 # DFA_XTRA = pngusr.dfa 22 23 # CPPFLAGS should contain the options to control the result, 24 # but DEFS and CFLAGS are also supported here, override 25 # as appropriate 26 DFNFLAGS = $(DEFS) $(CPPFLAGS) $(CFLAGS) 27 28 # srcdir is a defacto standard for the location of the source 29 srcdir = . 30 31 # The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt, 32 # copy this if the following doesn't work. 33 pnglibconf.h: pnglibconf.dfn 34 $(DELETE) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp 35 $(ECHO) '#include "pnglibconf.dfn"' >pnglibconf.c 36 $(ECHO) "If '$(CC) -E' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2 37 $(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out 38 $(AWK) -f "$(srcdir)/scripts/dfn.awk" out="pnglibconf.tmp" pnglibconf.out 1>&2 39 $(MOVE) pnglibconf.tmp $@ 40 41 pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h $(srcdir)/pngusr.dfa $(DFA_XTRA) 42 $(DELETE) $@ pnglibconf.pre pnglibconf.tmp 43 $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2 44 $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2 45 $(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.pre"\ 46 version=search $(srcdir)/pngconf.h $(srcdir)/scripts/pnglibconf.dfa\ 47 $(srcdir)/pngusr.dfa $(DFA_XTRA) 1>&2 48 $(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.tmp" pnglibconf.pre 1>&2 49 $(MOVE) pnglibconf.tmp $@ 50 51 clean-pnglibconf: 52 $(DELETE) pnglibconf.* 53 54 clean: clean-pnglibconf 55