Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | #! gmake |
michael@0 | 2 | |
michael@0 | 3 | # |
michael@0 | 4 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 7 | |
michael@0 | 8 | |
michael@0 | 9 | MOD_DEPTH = . |
michael@0 | 10 | topsrcdir = @top_srcdir@ |
michael@0 | 11 | srcdir = @srcdir@ |
michael@0 | 12 | VPATH = @srcdir@ |
michael@0 | 13 | |
michael@0 | 14 | include $(MOD_DEPTH)/config/autoconf.mk |
michael@0 | 15 | |
michael@0 | 16 | DIRS = config pr lib |
michael@0 | 17 | |
michael@0 | 18 | ifdef MOZILLA_CLIENT |
michael@0 | 19 | # Make nsinstall use absolute symlinks by default for Mozilla OSX builds |
michael@0 | 20 | # http://bugzilla.mozilla.org/show_bug.cgi?id=193164 |
michael@0 | 21 | ifeq ($(OS_ARCH),Darwin) |
michael@0 | 22 | ifndef NSDISTMODE |
michael@0 | 23 | NSDISTMODE=absolute_symlink |
michael@0 | 24 | export NSDISTMODE |
michael@0 | 25 | endif |
michael@0 | 26 | endif |
michael@0 | 27 | endif |
michael@0 | 28 | |
michael@0 | 29 | DIST_GARBAGE = config.cache config.log config.status |
michael@0 | 30 | |
michael@0 | 31 | all:: config.status export |
michael@0 | 32 | |
michael@0 | 33 | include $(topsrcdir)/config/rules.mk |
michael@0 | 34 | |
michael@0 | 35 | config.status:: configure |
michael@0 | 36 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 37 | sh $(srcdir)/configure --no-create --no-recursion |
michael@0 | 38 | else |
michael@0 | 39 | ./config.status --recheck && ./config.status |
michael@0 | 40 | endif |
michael@0 | 41 | |
michael@0 | 42 | # |
michael@0 | 43 | # The -ll option of zip converts CR LF to LF. |
michael@0 | 44 | # |
michael@0 | 45 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 46 | ZIP_ASCII_OPT = -ll |
michael@0 | 47 | endif |
michael@0 | 48 | |
michael@0 | 49 | # Delete config/autoconf.mk last because it is included by every makefile. |
michael@0 | 50 | distclean:: |
michael@0 | 51 | @echo "cd pr/tests; $(MAKE) $@" |
michael@0 | 52 | @$(MAKE) -C pr/tests $@ |
michael@0 | 53 | rm -f config/autoconf.mk |
michael@0 | 54 | rm -f `cat unallmakefiles` unallmakefiles |
michael@0 | 55 | |
michael@0 | 56 | release:: |
michael@0 | 57 | echo $(BUILD_NUMBER) > $(RELEASE_DIR)/$(BUILD_NUMBER)/version.df |
michael@0 | 58 | @if test -f imports.df; then \ |
michael@0 | 59 | echo "cp -f imports.df $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df"; \ |
michael@0 | 60 | cp -f imports.df $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df; \ |
michael@0 | 61 | else \ |
michael@0 | 62 | echo "echo > $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df"; \ |
michael@0 | 63 | echo > $(RELEASE_DIR)/$(BUILD_NUMBER)/imports.df; \ |
michael@0 | 64 | fi |
michael@0 | 65 | cd $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME); \ |
michael@0 | 66 | rm -rf META-INF; mkdir META-INF; cd META-INF; \ |
michael@0 | 67 | echo "Manifest-Version: 1.0" > MANIFEST.MF; \ |
michael@0 | 68 | echo "" >> MANIFEST.MF; \ |
michael@0 | 69 | cd ..; rm -f mdbinary.jar; zip -r mdbinary.jar META-INF bin lib; \ |
michael@0 | 70 | rm -rf META-INF; \ |
michael@0 | 71 | cd include; \ |
michael@0 | 72 | rm -rf META-INF; mkdir META-INF; cd META-INF; \ |
michael@0 | 73 | echo "Manifest-Version: 1.0" > MANIFEST.MF; \ |
michael@0 | 74 | echo "" >> MANIFEST.MF; \ |
michael@0 | 75 | cd ..; rm -f mdheader.jar; zip $(ZIP_ASCII_OPT) -r mdheader.jar *; \ |
michael@0 | 76 | rm -rf META-INF |
michael@0 | 77 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 78 | @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \ |
michael@0 | 79 | rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 80 | echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \ |
michael@0 | 81 | mkdir -p $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 82 | fi |
michael@0 | 83 | @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \ |
michael@0 | 84 | rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 85 | echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \ |
michael@0 | 86 | mkdir -p $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 87 | fi |
michael@0 | 88 | else |
michael@0 | 89 | @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); then \ |
michael@0 | 90 | rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 91 | echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)"; \ |
michael@0 | 92 | $(NSINSTALL) -D $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 93 | chmod 775 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 94 | fi |
michael@0 | 95 | @if test ! -d $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); then \ |
michael@0 | 96 | rm -rf $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 97 | echo "making directory $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)"; \ |
michael@0 | 98 | $(NSINSTALL) -D $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 99 | chmod 775 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 100 | fi |
michael@0 | 101 | endif |
michael@0 | 102 | cd $(RELEASE_DIR)/$(BUILD_NUMBER); \ |
michael@0 | 103 | cp -f version.df imports.df $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER); \ |
michael@0 | 104 | chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/version.df; \ |
michael@0 | 105 | chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \ |
michael@0 | 106 | cd $(OBJDIR_NAME); \ |
michael@0 | 107 | cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 108 | chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdbinary.jar; \ |
michael@0 | 109 | cd include; \ |
michael@0 | 110 | cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \ |
michael@0 | 111 | chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdheader.jar |
michael@0 | 112 | |
michael@0 | 113 | package: |
michael@0 | 114 | @echo "cd pkg; $(MAKE) publish" |
michael@0 | 115 | $(MAKE) -C pkg publish |
michael@0 | 116 | |
michael@0 | 117 | depend: |
michael@0 | 118 | @echo "NSPR20 has no dependencies. Skipped." |