pnglibconf.mak 2.1 KB

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