2010-04-17 13:17:51 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# pnglibconf.mak - standard make lines for pnglibconf.h
|
2011-05-07 15:52:49 +00:00
|
|
|
#
|
2010-04-17 13:17:51 +00:00
|
|
|
# These lines are copied from Makefile.am, they illustrate
|
|
|
|
# how to automate the build of pnglibconf.h from scripts/pnglibconf.dfa
|
2013-03-02 20:58:22 +00:00
|
|
|
# given just 'awk', a C preprocessor and standard command line utilities
|
2010-04-17 13:17:51 +00:00
|
|
|
|
2010-06-21 17:28:05 +00:00
|
|
|
# Override as appropriate, these definitions can be overridden on
|
|
|
|
# the make command line (AWK='nawk' for example).
|
|
|
|
AWK = gawk
|
|
|
|
AWK = mawk
|
|
|
|
AWK = nawk
|
|
|
|
AWK = one-true-awk
|
|
|
|
AWK = awk # Crashes on SunOS 5.10 - use 'nawk'
|
2013-03-02 20:58:22 +00:00
|
|
|
CPP = $(CC) -E # On SUN OS 5.10 if this causes problems use /lib/cpp
|
2011-03-22 11:28:27 +00:00
|
|
|
|
2013-03-02 20:58:22 +00:00
|
|
|
MOVE = mv
|
2010-04-17 13:17:51 +00:00
|
|
|
DELETE = rm -f
|
|
|
|
ECHO = echo
|
2013-03-02 20:58:22 +00:00
|
|
|
DFA_XTRA = # Put your configuration file here, see scripts/pnglibconf.dfa. Eg:
|
|
|
|
# DFA_XTRA = pngusr.dfa
|
2010-04-17 13:17:51 +00:00
|
|
|
|
|
|
|
# CPPFLAGS should contain the options to control the result,
|
|
|
|
# but DEFS and CFLAGS are also supported here, override
|
|
|
|
# as appropriate
|
|
|
|
DFNFLAGS = $(DEFS) $(CPPFLAGS) $(CFLAGS)
|
|
|
|
|
2010-04-28 12:52:16 +00:00
|
|
|
# srcdir is a defacto standard for the location of the source
|
|
|
|
srcdir = .
|
|
|
|
|
2010-08-24 21:16:35 +00:00
|
|
|
# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
|
2010-04-17 13:17:51 +00:00
|
|
|
# copy this if the following doesn't work.
|
|
|
|
pnglibconf.h: pnglibconf.dfn
|
2013-03-02 20:58:22 +00:00
|
|
|
$(DELETE) $@ pnglibconf.c pnglibconf.out pnglibconf.tmp
|
|
|
|
$(ECHO) '#include "pnglibconf.dfn"' >pnglibconf.c
|
|
|
|
$(ECHO) "If '$(CC) -E' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
|
|
|
|
$(CPP) $(DFNFLAGS) pnglibconf.c >pnglibconf.out
|
|
|
|
$(AWK) -f "$(srcdir)/scripts/dfn.awk" out="pnglibconf.tmp" pnglibconf.out 1>&2
|
|
|
|
$(MOVE) pnglibconf.tmp $@
|
|
|
|
|
|
|
|
pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk $(srcdir)/pngconf.h $(srcdir)/pngusr.dfa $(DFA_XTRA)
|
|
|
|
$(DELETE) $@ pnglibconf.pre pnglibconf.tmp
|
2010-06-21 17:28:05 +00:00
|
|
|
$(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
|
|
|
|
$(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
|
2013-03-02 20:58:22 +00:00
|
|
|
$(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.pre"\
|
|
|
|
version=search $(srcdir)/pngconf.h $(srcdir)/scripts/pnglibconf.dfa\
|
|
|
|
$(srcdir)/pngusr.dfa $(DFA_XTRA) 1>&2
|
|
|
|
$(AWK) -f $(srcdir)/scripts/options.awk out="pnglibconf.tmp" pnglibconf.pre 1>&2
|
|
|
|
$(MOVE) pnglibconf.tmp $@
|
2010-04-17 13:17:51 +00:00
|
|
|
|
|
|
|
clean-pnglibconf:
|
2015-03-21 20:53:44 +00:00
|
|
|
$(DELETE) pnglibconf.h pnglibconf.c pnglibconf.out pnglibconf.pre \
|
|
|
|
pnglibconf.dfn
|
2010-04-17 13:17:51 +00:00
|
|
|
|
|
|
|
clean: clean-pnglibconf
|