annotate binary-dist-rules.mk @ 3435:9fcc72373e24

build stable-octave package by default * Makefile.in (STABLE_BUILD): Set default to yes. (OCTAVE_TARGET): Set here instead of in binary-dist-rules.mk * binary-dist-rules.mk: Use WINDOWS_BINARY_DIST_DEPS instead of WINDOWS_BINARY_DIST_FILES. (make-stable-dist-directory): Delete macro definition.
author John W. Eaton <jwe@octave.org>
date Mon, 20 Jan 2014 03:00:19 -0500
parents 4779ae33e544
children ebe73c541a16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3431
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 ifeq ($(STABLE_BUILD),yes)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 OCTAVE_DIST_NAME := octave-$($(OCTAVE_TARGET)_VERSION)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 else
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 OCTAVE_DIST_NAME := octave-$(DATE)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 endif
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 OCTAVE_DIST_DIR := $(TOP_DIR)/dist/$(OCTAVE_DIST_NAME)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 OCTAVE_NSI_FILE := $(TOP_DIR)/dist/octave.nsi
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 ## FIXME: We need a way to ask "is this a windows build?"
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ifeq ($(MXE_SYSTEM), mingw)
3435
9fcc72373e24 build stable-octave package by default
John W. Eaton <jwe@octave.org>
parents: 3433
diff changeset
14 WINDOWS_BINARY_DIST_DEPS := msys-base npp
3431
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 endif
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 ifeq ($(MXE_SYSTEM), msvc)
3435
9fcc72373e24 build stable-octave package by default
John W. Eaton <jwe@octave.org>
parents: 3433
diff changeset
17 WINDOWS_BINARY_DIST_DEPS := msys-base npp
3431
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 endif
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 BINARY_DIST_DEPS := \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 $(OCTAVE_TARGET) \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 native-gcc \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 native-binutils \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 octave-forge-packages \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 units \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 transfig \
3435
9fcc72373e24 build stable-octave package by default
John W. Eaton <jwe@octave.org>
parents: 3433
diff changeset
27 $(WINDOWS_BINARY_DIST_DEPS)
3431
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 define delete-dist-directory
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 echo "deleting previous dist directory..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 rm -rf $(TOP_DIR)/dist
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 define make-dist-directory
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 echo "creating dist directory..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 mkdir -p $(OCTAVE_DIST_DIR)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 define generate-dist-exclude-list
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 echo "generating lists of files to exclude..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 echo " native files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 echo "./$(TARGET)" > $(TOP_DIR)/excluded-native-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 echo "./bin/$(TARGET)-*.exe" >> $(TOP_DIR)/excluded-native-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 echo " gcc cross compiler files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 cd $(TOP_DIR)/cross-tools/$(HOST_PREFIX) \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 && find . -type f -o -type l | sed "s,./,," > $(TOP_DIR)/excluded-gcc-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 define copy-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 echo "copying files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 echo " octave and dependencies..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 cd $(HOST_PREFIX) \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 && tar -c -h -X $(TOP_DIR)/excluded-gcc-files -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 echo " octaverc file..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 cp $(TOP_DIR)/build_packages.m $(OCTAVE_DIST_DIR)/src \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 && cp $(TOP_DIR)/octaverc $(OCTAVE_DIST_DIR)/share/octave/site/m/startup/octaverc
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 echo " native tools..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 cd $(TOP_DIR)/native-tools/usr \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 && tar -c -h -X $(TOP_DIR)/excluded-native-files -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 echo " libgcc_s_dw2-1.dll to bin directory"
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 cd $(OCTAVE_DIST_DIR) \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 && cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 echo " msys base files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 cd $(TOP_DIR)/msys-base \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 && tar -c -h -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 echo " msys extension files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 cd $(TOP_DIR)/msys-extension \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 && tar -c -h -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 echo " notepad++..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 cd $(TOP_DIR) \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 && tar -c -h -f - notepad++ | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 echo " build_packages.m..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 cp $(TOP_DIR)/build_packages.m $(OCTAVE_DIST_DIR)/src
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 define make-dist-files-writable
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 echo "making all dist files writable by user..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 chmod -R u+w $(OCTAVE_DIST_DIR)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 ifeq ($(STRIP_DIST_FILES),yes)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 define strip-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 echo "stripping files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 for f in $$(find $(OCTAVE_DIST_DIR) -name '*.dll' -o -name '*.exe'); do \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 $(MXE_STRIP) $$f; \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 done
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 else
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 define strip-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 echo "not stripping files..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 endif
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 .PHONY: binary-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 binary-dist-files: $(BINARY_DIST_DEPS)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 @$(delete-dist-directory)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 @$(make-dist-directory)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 @$(generate-dist-exclude-list)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 @$(copy-dist-files)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 @$(make-dist-files-writable)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 @$(strip-dist-files)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 define make-installer-file
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 echo "generating installer script..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 ./makeinst-script.sh $(OCTAVE_DIST_DIR) $(OCTAVE_NSI_FILE)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 echo "generating installer..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 $(TARGET)-makensis $(OCTAVE_NSI_FILE) > $(TOP_DIR)/dist/nsis.log
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 echo "deleting installer script..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 rm -f $(OCTAVE_NSI_FILE)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 $(OCTAVE_DIST_NAME)-installer.exe: nsis binary-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 @$(make-installer-file)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 .PHONY: nsis-installer
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 nsis-installer: $(OCTAVE_DIST_NAME)-installer.exe
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 define make-zip-dist
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 echo "generating zip file..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 cd $(TOP_DIR)/dist \
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 && zip -q -9 -r $(OCTAVE_DIST_NAME).zip $(OCTAVE_DIST_NAME)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 .PHONY: zip-dist
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 zip-dist: binary-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 @$(make-zip-dist)
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 define make-tar-dist
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 echo "generating tar file..."
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 cd $(TOP_DIR)/dist \
3432
5fc3d674ca3a Correctly name output of dist-tar with .tgz, not .zip, extension.
Rik <rik@octave.org>
parents: 3431
diff changeset
131 && tar -c -z -f $(OCTAVE_DIST_NAME).tgz $(OCTAVE_DIST_NAME)
3431
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 endef
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 .PHONY: tar-dist
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 tar-dist: binary-dist-files
a7c772aa106f Move mk-dist script functionality into Makefile.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136 @$(make-tar-dist)