Admin/website/build/main.mak
changeset 20110 c2ffa1783319
parent 20109 47fef41c68fb
child 20111 ba1676dd3546
equal deleted inserted replaced
20109:47fef41c68fb 20110:c2ffa1783319
     1 # isaweb makefile
       
     2 # $Id$
       
     3 
       
     4 # force shell
       
     5 SHELL=bash
       
     6 
       
     7 # some global variables
       
     8 CONF=conf/localconf.mak
       
     9 
       
    10 # configuration switch
       
    11 ifeq ($(phase), init)
       
    12 
       
    13 # allocate configuration
       
    14 init:
       
    15 	mkdir -p conf
       
    16 	case $$HOSTNAME in sunbroy*) ARCH=sun;; *) ARCH=at;; esac; \
       
    17 	sed 's/# $$Id.*//g' build/localconf.$$ARCH.template.mak > $(CONF)
       
    18 	$$EDITOR $(CONF)
       
    19 	@false
       
    20 .PHONY: init
       
    21 
       
    22 else
       
    23 
       
    24 # default target
       
    25 default: project
       
    26 
       
    27 # check configuration
       
    28 include $(CONF)
       
    29 $(CONF):
       
    30 	@if [ ! -e $(CONF) ]; \
       
    31 	then \
       
    32 		echo 'Framework not configured yet; set EDITOR environment variable'; \
       
    33 		echo 'to your favorite editor and type'; \
       
    34 		echo; \
       
    35 		echo '    make phase=init'; \
       
    36 		echo; \
       
    37 		echo 'to configure it'; \
       
    38 		false; \
       
    39 	else \
       
    40 		:; \
       
    41 	fi
       
    42 
       
    43 # tidy handling
       
    44 ifeq ($(DISABLE_TIDY),)
       
    45 TIDYCMD=$(TIDY) -q -i -asxhtml --output-xhtml true \
       
    46                 --doctype auto \
       
    47                 --literal-attributes true \
       
    48                 --wrap 0 \
       
    49                 --indent auto --indent-spaces 2 \
       
    50                 --input-encoding utf8 --output-encoding latin1 \
       
    51                 --logical-emphasis yes --gnu-emacs yes --write-back yes
       
    52 else
       
    53 TIDYCMD=:
       
    54 endif
       
    55 
       
    56 # dependencies
       
    57 DEP_FILE=conf/depends.mak
       
    58 site: $(DEP_FILE) allsite
       
    59 .PHONY: site
       
    60 
       
    61 # import dependencies
       
    62 include $(DEP_FILE)
       
    63 endif
       
    64 
       
    65 # pypager iso-8859-1 hack
       
    66 ifneq ($(FORCE_ISO_8859_1),)
       
    67 FORCE_ENC_CMD=--encodinghtml "iso-8859-1"
       
    68 else
       
    69 FORCE_ENC_CMD=
       
    70 endif
       
    71 
       
    72 # import project-specific dependencies
       
    73 include build/project.mak
       
    74 
       
    75 # build dependencies
       
    76 $(DEP_FILE): $(CONF)
       
    77 	build/make_dep.bash "$(FIND)" "$(OUTPUTROOT)" "$(DEP_FILE)" "$(STATICDIRS)" "$(STATICFILES)"
       
    78 
       
    79 # build dependencies explicitly
       
    80 depends:
       
    81 	rm -f $(DEP_FILE)
       
    82 	$(MAKE) $(DEP_FILE)
       
    83 .PHONY: depends
       
    84 
       
    85 # clean build files
       
    86 clean:
       
    87 	rm -f $(DEP_FILE)
       
    88 .PHONY: clean