home *** CD-ROM | disk | FTP | other *** search
/ hobbes.nmsu.edu 2008 / 2008-06-02_hobbes.nmsu.edu.zip / new / scummc-0.2.0-os2.zip / ScummC / examples / openquest / Makefile < prev    next >
Encoding:
Makefile  |  2008-02-08  |  2.4 KB  |  97 lines

  1. #
  2. #  ScummC Makefile
  3. #  Copyright (C) 2006  Alban Bedel
  4. #  This program is free software; you can redistribute it and/or
  5. #  modify it under the terms of the GNU General Public License
  6. #  as published by the Free Software Foundation; either version 2
  7. #  of the License, or (at your option) any later version.
  8. #
  9. #  This program is distributed in the hope that it will be useful,
  10. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. #  GNU General Public License for more details.
  13. #
  14. #  You should have received a copy of the GNU General Public License
  15. #  along with this program; if not, write to the Free Software
  16. #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  17. #
  18.  
  19.  
  20. SRCS= common.scc officeroom.scc inventoryitems.scc secretroom.scc dialog.scc verbs.scc actors.scc
  21.  
  22. host=$(shell uname -n | cut -d . -f 1)
  23.  
  24. SRCDIR?=../..
  25.  
  26. include $(SRCDIR)/config.$(host).mak
  27.  
  28. EXP_DIR=$(SRCDIR)/examples/openquest
  29.  
  30. COST_DIR=$(EXP_DIR)/costumes
  31.  
  32. FONT_DIR=$(EXP_DIR)/fonts
  33.  
  34. REF_FILE=$(EXP_DIR)/openquest.md5
  35.  
  36. BIN_PATH=$(SRCDIR)/$(BUILDROOT)/$(TARGET)
  37.  
  38. SCC=$(BIN_PATH)/scc
  39. SLD=$(BIN_PATH)/sld
  40. COST=$(BIN_PATH)/cost
  41. CHAR=$(BIN_PATH)/char
  42.  
  43. SCC_FLAGS= -I $(SRCDIR) -I $(EXP_DIR) -R $(EXP_DIR)
  44.  
  45. OBJS=$(SRCS:%.scc=%.roobj)
  46. EXP_SRCS=$(SRCS:%=$(EXP_DIR)/%)
  47.  
  48.  
  49. all: scummc6.000 scummc6.001 scummc6.sou
  50.  
  51.  
  52. %.cost: $(COST_DIR)/%.scost $(COST)
  53.     $(COST) -o $@ -I $(COST_DIR) -header $*_anim.sch -prefix $*_anim_ $<
  54.  
  55. %_anim.sch: %.cost ;
  56.  
  57. %.char: $(FONT_DIR)/%.bmp $(CHAR)
  58.     $(CHAR) -ochar $@ -ibmp $<
  59.  
  60. %.roobj: $(EXP_DIR)/%.scc $(SCC)
  61.     $(SCC) -o $@ $(SCC_FLAGS) $<
  62.  
  63. scummc6.000: $(OBJS)
  64.     $(SLD) -v $^ 
  65. #-key 0x69
  66.  
  67. scummc6.001 scummc.sou: scummc6.000 ;
  68.  
  69. clean:
  70.     rm -f openquest.dep scummc.0?? *.char scummc.sou *.roobj *.cost \
  71.           *_anim.sch
  72.  
  73. distclean: clean
  74.  
  75.  
  76. openquest.dep: $(EXP_SRCS)
  77.     $(SCC) -d -o $@ $(SCC_FLAGS) $^
  78.  
  79. -include openquest.dep
  80.  
  81. ### Regression testing
  82.  
  83. ## Update the reference hash.
  84. test-ref: scummc6.000 scummc6.001 scummc6.sou
  85.     @for f in $+ ; do printf "%s: " $$f ; $(MD5SUM) < $$f | cut -d ' ' -f 1 ; done > $(REF_FILE)
  86.     @echo "Reference hash updated."
  87.  
  88. test: scummc6.000 scummc6.001 scummc6.sou
  89.     @[ -f $(REF_FILE) ] || ( echo "No reference hash available" ; false )
  90.     @for f in $+ ; do \
  91.            printf "%s: " $$f ; \
  92.            $(MD5SUM) < $$f | cut -d ' ' -f 1 ; \
  93.         done | diff -u $(REF_FILE) -
  94.  
  95. .PHONY: clean distclean test-ref test
  96.