Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.9 KiB

  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 'awk' and 'sed'
  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 # Does not work on SUN OS 5.10 - use /lib/cpp
  15. SED = sed
  16. COPY = cp
  17. DELETE = rm -f
  18. ECHO = echo
  19. DFA_XTRA = # Appended to scripts/options.awk
  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) $@ dfn.c dfn1.out dfn2.out dfn3.out
  30. $(ECHO) '#include "pnglibconf.dfn"' >dfn.c
  31. $(CPP) $(DFNFLAGS) dfn.c >dfn1.out
  32. $(ECHO) "If 'cpp -e' crashes try /lib/cpp (e.g. CPP='/lib/cpp')" >&2
  33. $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
  34. dfn1.out >dfn2.out
  35. $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out
  36. $(COPY) dfn3.out $@
  37. $(DELETE) dfn.c dfn1.out dfn2.out dfn3.out
  38. pnglibconf.dfn: $(srcdir)/scripts/pnglibconf.dfa $(srcdir)/scripts/options.awk
  39. $(DELETE) $@ dfn1.out dfn2.out
  40. $(ECHO) "Calling $(AWK) from scripts/pnglibconf.mak" >&2
  41. $(ECHO) "If 'awk' crashes try a better awk (e.g. AWK='nawk')" >&2
  42. $(AWK) -f $(srcdir)/scripts/options.awk out=dfn1.out\
  43. $(srcdir)/scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2
  44. $(AWK) -f $(srcdir)/scripts/options.awk out=dfn2.out dfn1.out 1>&2
  45. $(COPY) dfn2.out $@
  46. $(DELETE) dfn1.out dfn2.out
  47. clean-pnglibconf:
  48. $(DELETE) pnglibconf.h pnglibconf.dfn dfn.c dfn1.out dfn2.out dfn3.out
  49. clean: clean-pnglibconf