comparison binary-dist-rules.mk @ 4066:0962acdde3be

builld: allow out of source build * Makefile.in: add TOP_BUILD_DIR var and use TOP_DIR=srcdir, TOP_BUILD_DIR=builddir, modify paths to use TOP_DIR where needed * binary-dist-rules.mk: use TOP_DIR and TOP_BUILD_DIR where needed * makeinst-script.sh: use script path to determine TOPDIR, use TOPDIR where needed * src/default-octave.mk: install octave-version to builddir * src/stable-octave.mk: install octave-version to builddir * src/octave.mk: install octave-version to builddir * tools/set-mxe-env.sh.in: update fir builddir and srcdir use
author John Donoghue
date Wed, 23 Dec 2015 08:11:04 -0500
parents 8803dfa40236
children e5e0b3f7244b
comparison
equal deleted inserted replaced
4065:aacf84e7af56 4066:0962acdde3be
3 OCTAVE_DIST_NAME := octave-$($(OCTAVE_TARGET)_VERSION) 3 OCTAVE_DIST_NAME := octave-$($(OCTAVE_TARGET)_VERSION)
4 else 4 else
5 OCTAVE_DIST_NAME := octave-$(DATE) 5 OCTAVE_DIST_NAME := octave-$(DATE)
6 endif 6 endif
7 7
8 OCTAVE_DIST_DIR := $(TOP_DIR)/dist/$(OCTAVE_DIST_NAME) 8 OCTAVE_DIST_DIR := $(TOP_BUILD_DIR)/dist/$(OCTAVE_DIST_NAME)
9 9
10 OCTAVE_NSI_FILE := $(TOP_DIR)/dist/octave.nsi 10 OCTAVE_NSI_FILE := $(TOP_BUILD_DIR)/dist/octave.nsi
11 11
12 ifeq ($(MXE_WINDOWS_BUILD),yes) 12 ifeq ($(MXE_WINDOWS_BUILD),yes)
13 TAR_H_OPTION := -h 13 TAR_H_OPTION := -h
14 WINDOWS_BINARY_DIST_DEPS := \ 14 WINDOWS_BINARY_DIST_DEPS := \
15 msys-base \ 15 msys-base \
33 transfig \ 33 transfig \
34 $(WINDOWS_BINARY_DIST_DEPS) 34 $(WINDOWS_BINARY_DIST_DEPS)
35 35
36 define delete-dist-directory 36 define delete-dist-directory
37 echo "deleting previous dist directory..." 37 echo "deleting previous dist directory..."
38 rm -rf $(TOP_DIR)/dist 38 rm -rf $(TOP_BUILD_DIR)/dist
39 endef 39 endef
40 40
41 define make-dist-directory 41 define make-dist-directory
42 echo "creating dist directory..." 42 echo "creating dist directory..."
43 mkdir -p $(OCTAVE_DIST_DIR) 43 mkdir -p $(OCTAVE_DIST_DIR)
60 echo " DLL files..." 60 echo " DLL files..."
61 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin 61 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin
62 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin 62 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin
63 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$(build-gcc_VERSION)/*.dll $(OCTAVE_DIST_DIR)/bin 63 cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$(build-gcc_VERSION)/*.dll $(OCTAVE_DIST_DIR)/bin
64 echo " msys base files..." 64 echo " msys base files..."
65 cd $(TOP_DIR)/msys-base \ 65 cd $(TOP_BUILD_DIR)/msys-base \
66 && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ) 66 && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
67 echo " msys extension files..." 67 echo " msys extension files..."
68 cd $(TOP_DIR)/msys-extension \ 68 cd $(TOP_BUILD_DIR)/msys-extension \
69 && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ) 69 && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
70 echo " notepad++..." 70 echo " notepad++..."
71 cd $(TOP_DIR) \ 71 cd $(TOP_BUILD_DIR) \
72 && tar -c $(TAR_H_OPTION) -f - notepad++ | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ) 72 && tar -c $(TAR_H_OPTION) -f - notepad++ | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
73 echo " README.html..." 73 echo " README.html..."
74 cp $(TOP_DIR)/installer-files/README.html $(OCTAVE_DIST_DIR)/ 74 cp $(TOP_DIR)/installer-files/README.html $(OCTAVE_DIST_DIR)/
75 echo " refblas..." 75 echo " refblas..."
76 cp $(OCTAVE_DIST_DIR)/bin/libblas.dll $(OCTAVE_DIST_DIR)/bin/librefblas.dll 76 cp $(OCTAVE_DIST_DIR)/bin/libblas.dll $(OCTAVE_DIST_DIR)/bin/librefblas.dll
172 if [ -f $(OCTAVE_NSI_FILE) ]; then \ 172 if [ -f $(OCTAVE_NSI_FILE) ]; then \
173 echo "deleting previous installer script..."; \ 173 echo "deleting previous installer script..."; \
174 rm -f $(OCTAVE_NSI_FILE); \ 174 rm -f $(OCTAVE_NSI_FILE); \
175 fi 175 fi
176 echo "generating installer script..." 176 echo "generating installer script..."
177 ./makeinst-script.sh $(OCTAVE_DIST_DIR) $(OCTAVE_NSI_FILE) 177 $(TOP_DIR)/makeinst-script.sh $(OCTAVE_DIST_DIR) $(OCTAVE_NSI_FILE)
178 echo "generating installer..." 178 echo "generating installer..."
179 $(TARGET)-makensis $(OCTAVE_NSI_FILE) > $(TOP_DIR)/dist/nsis.log 179 $(TARGET)-makensis $(OCTAVE_NSI_FILE) > $(TOP_BUILD_DIR)/dist/nsis.log
180 endef 180 endef
181 181
182 $(OCTAVE_DIST_NAME)-installer.exe: nsis binary-dist-files 182 $(OCTAVE_DIST_NAME)-installer.exe: nsis binary-dist-files
183 @$(make-installer-file) 183 @$(make-installer-file)
184 184
185 .PHONY: nsis-installer 185 .PHONY: nsis-installer
186 nsis-installer: $(OCTAVE_DIST_NAME)-installer.exe 186 nsis-installer: $(OCTAVE_DIST_NAME)-installer.exe
187 187
188 define make-zip-dist 188 define make-zip-dist
189 echo "generating zip file..." 189 echo "generating zip file..."
190 cd $(TOP_DIR)/dist \ 190 cd $(TOP_BUILD_DIR)/dist \
191 && zip -q -9 -r $(OCTAVE_DIST_NAME).zip $(OCTAVE_DIST_NAME) 191 && zip -q -9 -r $(OCTAVE_DIST_NAME).zip $(OCTAVE_DIST_NAME)
192 endef 192 endef
193 193
194 .PHONY: zip-dist 194 .PHONY: zip-dist
195 zip-dist: binary-dist-files 195 zip-dist: binary-dist-files
196 @$(make-zip-dist) 196 @$(make-zip-dist)
197 197
198 define make-tar-dist 198 define make-tar-dist
199 echo "generating tar file..." 199 echo "generating tar file..."
200 cd $(TOP_DIR)/dist \ 200 cd $(TOP_BUILD_DIR)/dist \
201 && tar -c -z -f $(OCTAVE_DIST_NAME).tgz $(OCTAVE_DIST_NAME) 201 && tar -c -z -f $(OCTAVE_DIST_NAME).tgz $(OCTAVE_DIST_NAME)
202 endef 202 endef
203 203
204 .PHONY: tar-dist 204 .PHONY: tar-dist
205 tar-dist: binary-dist-files 205 tar-dist: binary-dist-files