Newer
Older
Digital_Repository / Repositories / phpSurveyor / Makefile
  1. SHELL=/bin/sh
  2.  
  3. # Load in machine-specific environment settings from environment_config.make.
  4. # This include file MUST be created and MUST define the following variables:
  5. #
  6. # SURVEYOR_ROOT: /path/to/phpsurveyor/installation
  7. # SURVEYOR_USER: the user that owns the phpSurveyor directory
  8. # SURVEYOR_PORT: appropriate HTTP port
  9. # SURVEYOR_ADMIN_EMAIL: administrator email address (quote "@" with \)
  10. # SURVEYOR_ADMIN_NAME: administrator real name
  11. #
  12. include environment_config.make
  13.  
  14.  
  15. BINDIR:=$(EPRINTSSTATS)/scripts
  16.  
  17. GENERATED_FILES:=config.php apache.conf
  18.  
  19. CONFIG_SUBS:=SURVEYOR_ROOT SURVEYOR_PORT SURVEYOR_ADMIN_EMAIL SURVEYOR_ADMIN_NAME
  20.  
  21.  
  22. .PHONY: deploy stats
  23.  
  24.  
  25. deploy: $(GENERATED_FILES)
  26. @announce "Copying files..."
  27. @sudo -u $(SURVEYOR_USER) rsync --verbose --cvs-exclude --exclude=Makefile \
  28. --exclude='*.make' --exclude='*_src.*' \
  29. --recursive --times . $(SURVEYOR_ROOT)
  30.  
  31.  
  32. config.php: config_src.php environment_config.make
  33. @announce "Generating $@"
  34. perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
  35.  
  36. apache.conf: apache_src.conf environment_config.make
  37. @announce "Generating $@"
  38. perl -p $(foreach SUB,$(CONFIG_SUBS),-e "s|##$(SUB)##|$($(SUB))|g;") $< > $@
  39.  
  40.  
  41. debug:
  42. @echo "SURVEYOR_ROOT = [$(SURVEYOR_ROOT)]"