Makefile
changeset 480 4413ccc9e216
parent 479 6c408af00436
child 481 f2b8c358716d
equal deleted inserted replaced
479:6c408af00436 480:4413ccc9e216
    41 endif
    41 endif
    42 
    42 
    43 ################################################################
    43 ################################################################
    44 # Version extracting/generation.
    44 # Version extracting/generation.
    45 
    45 
    46 VER_FILE := dist/misc/VERSION
    46 VER_FILE := VERSION
    47 
    47 
    48 # Prevent making distribution with wrong version.
    48 # Prevent making distribution with wrong version.
    49 ifneq '' '$(filter deploy% dist%,$(MAKECMDGOALS))'
    49 ifneq '' '$(filter deploy% dist%,$(MAKECMDGOALS))'
    50   ifeq '' '$(MAKE_RESTARTS)'
    50   ifeq '' '$(MAKE_RESTARTS)'
    51     $(shell rm -f $(VER_FILE))
    51     $(shell rm -f $(VER_FILE))
   305 dist-src: $(DISTSRC_TARBALLS)
   305 dist-src: $(DISTSRC_TARBALLS)
   306 
   306 
   307 DISTSRC_GADICT_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GADICT_FILES))
   307 DISTSRC_GADICT_FILES := $(patsubst %,dist/$(fullpkgname)_src/%,$(GADICT_FILES))
   308 DISTSRC_PY_FILES := $(patsubst %,dist/$(fullpkgname)_src/py/%,$(notdir $(PY_FILES)))
   308 DISTSRC_PY_FILES := $(patsubst %,dist/$(fullpkgname)_src/py/%,$(notdir $(PY_FILES)))
   309 DISTSRC_RST_FILES := $(patsubst %,dist/$(fullpkgname)_src/www/%,$(notdir $(RST_FILES)))
   309 DISTSRC_RST_FILES := $(patsubst %,dist/$(fullpkgname)_src/www/%,$(notdir $(RST_FILES)))
   310 DISTSRC_MAKEFILE := dist/$(fullpkgname)_src/Makefile
   310 DISTSRC_BUILD_SCRIPTS := $(patsubst %,dist/$(fullpkgname)_src/%, Makefile VERSION)
   311 
   311 
   312 dist/$(fullpkgname)_src.tar.gz: $(DISTSRC_GADICT_FILES) $(DISTSRC_PY_FILES) $(DISTSRC_RST_FILES) $(DISTSRC_MAKEFILE) $(BUILD_SCRIPTS)
   312 dist/$(fullpkgname)_src.tar.gz: $(DISTSRC_GADICT_FILES) $(DISTSRC_PY_FILES) $(DISTSRC_RST_FILES) $(DISTSRC_BUILD_SCRIPTS) $(BUILD_SCRIPTS)
   313 	rm -rf $@
   313 	rm -rf $@
   314 	tar zcf $@ -C dist/ $(fullpkgname)_src
   314 	tar zcf $@ -C dist/ $(fullpkgname)_src
   315 
   315 
   316 $(DISTSRC_GADICT_FILES): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/
   316 $(DISTSRC_GADICT_FILES): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/
   317 	cp $< $@
   317 	cp $< $@
   320 	cp $< $@
   320 	cp $< $@
   321 
   321 
   322 $(DISTSRC_RST_FILES): dist/$(fullpkgname)_src/www/%: www/% | dist/$(fullpkgname)_src/www/
   322 $(DISTSRC_RST_FILES): dist/$(fullpkgname)_src/www/%: www/% | dist/$(fullpkgname)_src/www/
   323 	cp $< $@
   323 	cp $< $@
   324 
   324 
   325 $(DISTSRC_MAKEFILE): Makefile | dist/$(fullpkgname)_src/
   325 $(DISTSRC_BUILD_SCRIPTS): dist/$(fullpkgname)_src/%: % | dist/$(fullpkgname)_src/
   326 	cp $< $@
   326 	cp $< $@
   327 
   327 
   328 dist/$(fullpkgname)_src/ $(patsubst %,dist/$(fullpkgname)_src/%, py/ www/):
   328 dist/$(fullpkgname)_src/ $(patsubst %,dist/$(fullpkgname)_src/%, py/ www/):
   329 	mkdir -p $@
   329 	mkdir -p $@
   330 
   330 
   505 help:
   505 help:
   506 	@\
   506 	@\
   507 echo; \
   507 echo; \
   508 echo Current configuration:; \
   508 echo Current configuration:; \
   509 echo; \
   509 echo; \
   510 sed 's=^=  =' <VERSION
   510 sed 's=^=  =' <$(VER_FILE)
   511 	@if [ -f Makefile.config ]; then \
   511 	@if [ -f Makefile.config ]; then \
   512 		echo; \
   512 		echo; \
   513 		echo User configuration:; \
   513 		echo User configuration:; \
   514 		echo; \
   514 		echo; \
   515 		sed 's=^=  =' <Makefile.config; \
   515 		sed 's=^=  =' <Makefile.config; \
   535 ################################################################
   535 ################################################################
   536 # Clean targets.
   536 # Clean targets.
   537 
   537 
   538 .PHONY: distclean
   538 .PHONY: distclean
   539 distclean: clean
   539 distclean: clean
       
   540 	rm -rf $(VER_FILE)
   540 
   541 
   541 .PHONY: clean
   542 .PHONY: clean
   542 clean:
   543 clean:
   543 	rm -rf dist/
   544 	rm -rf dist/
   544 
   545