2 # pnglibconf.mak - standard make lines for pnglibconf.h
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
8 # Override as appropriate, these definitions can be overridden on
9 # the make command line (AWK='nawk' for example).
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
20 DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa. Eg:
21 # DFA_XTRA = pngusr.dfa
23 # CPPFLAGS should contain the options to control the result,
24 # but DEFS and CFLAGS are also supported here, override
26 DFNFLAGS = $(DEFS) $(CPPFLAGS) $(CFLAGS)
28 # srcdir is a defacto standard for the location of the source
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 $@
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 $@
52 $(DELETE) pnglibconf.*
54 clean: clean-pnglibconf