comparison Makefile.in @ 4194:3dc897731d3b

new option to enable ccache * configure.ac: New option, --with-ccache. Set and substitute MXE_TARGET variable. * Makefile.in (USE_CCACHE, MXE_TARGET): New substitutions. (prerequisites, ccache-links, all-targets): New targets. (all): Use recursive make invocations to build prerequisites before all other targets.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Aug 2016 13:26:30 -0400
parents 32814edc00db
children 084a0a865a6b
comparison
equal deleted inserted replaced
4193:32814edc00db 4194:3dc897731d3b
26 endif 26 endif
27 27
28 # Set to "no" if doing a cross compile build. 28 # Set to "no" if doing a cross compile build.
29 MXE_NATIVE_BUILD := @MXE_NATIVE_BUILD@ 29 MXE_NATIVE_BUILD := @MXE_NATIVE_BUILD@
30 30
31 # Set to "yes" to use ccache
32 USE_CCACHE := @USE_CCACHE@
33
31 # Set to "yes" to use the versions of GCC and binutils already 34 # Set to "yes" to use the versions of GCC and binutils already
32 # installed on your system (default is yes if doing native build). 35 # installed on your system (default is yes if doing native build).
33 USE_SYSTEM_GCC := @USE_SYSTEM_GCC@ 36 USE_SYSTEM_GCC := @USE_SYSTEM_GCC@
34 37
35 # Set to "yes" to use the version of fontconfig already installed 38 # Set to "yes" to use the version of fontconfig already installed
58 61
59 # create and install devel tools (default no) 62 # create and install devel tools (default no)
60 ENABLE_DEVEL_TOOLS := @ENABLE_DEVEL_TOOLS@ 63 ENABLE_DEVEL_TOOLS := @ENABLE_DEVEL_TOOLS@
61 64
62 # Should match what config.guess prints for your system. 65 # Should match what config.guess prints for your system.
63 # If cross compiling, you must set it manually. 66 # If cross compiling, you must set it manually (defaults are set by configure).
64 ifeq ($(MXE_NATIVE_BUILD),yes) 67 ifeq ($(MXE_NATIVE_BUILD),yes)
65 TARGET := $(shell $(TOP_DIR)/tools/config.guess) 68 TARGET := $(shell $(TOP_DIR)/tools/config.guess)
66 else 69 else
67 ifeq ($(ENABLE_WINDOWS_64),yes) 70 TARGET := @MXE_TARGET@
68 TARGET := x86_64-w64-mingw32
69 else
70 TARGET := i686-w64-mingw32
71 endif
72 endif 71 endif
73 BUILD_SYSTEM := $(shell $(TOP_DIR)/tools/config.guess) 72 BUILD_SYSTEM := $(shell $(TOP_DIR)/tools/config.guess)
74 73
75 # Enable shared or static libs, or perhaps both. Probably it doesn't 74 # Enable shared or static libs, or perhaps both. Probably it doesn't
76 # make sense to disable both... 75 # make sense to disable both...
250 MAKEFILE := $(TOP_BUILD_DIR)/Makefile 249 MAKEFILE := $(TOP_BUILD_DIR)/Makefile
251 PKGS := $(filter-out $(ALL_BUILD_TOOLS), $(shell $(SED) -n 's/^.* class="package">\([^<]*\)<.*$$/\1/p' '$(TOP_DIR)/index.html')) 250 PKGS := $(filter-out $(ALL_BUILD_TOOLS), $(shell $(SED) -n 's/^.* class="package">\([^<]*\)<.*$$/\1/p' '$(TOP_DIR)/index.html'))
252 251
253 ENV_PATH := $(PATH) 252 ENV_PATH := $(PATH)
254 PATH := $(BUILD_TOOLS_PREFIX)/bin:$(PATH) 253 PATH := $(BUILD_TOOLS_PREFIX)/bin:$(PATH)
254 ifeq ($(USE_CCACHE),yes)
255 PATH := $(BUILD_TOOLS_PREFIX)/bin/ccache:$(PATH)
256 CCACHE_LINKS_TARGET := ccache-links
257 endif
255 258
256 ENV_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH) 259 ENV_PKG_CONFIG_PATH := $(PKG_CONFIG_PATH)
257 260
258 CONFIGURE_CPPFLAGS := CPPFLAGS='-I$(HOST_PREFIX)/include' 261 CONFIGURE_CPPFLAGS := CPPFLAGS='-I$(HOST_PREFIX)/include'
259 ifeq ($(MXE_USE_LIB64_DIRECTORY),yes) 262 ifeq ($(MXE_USE_LIB64_DIRECTORY),yes)
505 echo '#PKGS ='; \ 508 echo '#PKGS ='; \
506 } >'$(TOP_BUILD_DIR)/settings.mk') 509 } >'$(TOP_BUILD_DIR)/settings.mk')
507 endif 510 endif
508 511
509 .PHONY: all 512 .PHONY: all
510 all: $(TOP_DIR)/configure Makefile $(OCTAVE_TARGET) 513 all:
514 $(MAKE) prerequisites
515 $(MAKE) all-targets
516
517 .PHONY: prerequisites
518 prerequisites: $(TOP_DIR)/configure Makefile $(CCACHE_LINKS_TARGET)
519
520 .PHONY: ccache-links
521 ccache-links:
522 @echo "creating ccache links"
523 @mkdir -p usr/bin/ccache && \
524 for f in gcc g++ gfortran; do \
525 if test ! -e usr/bin/ccache/$(MXE_TOOL_PREFIX)$$f; then \
526 ln -s /usr/bin/ccache usr/bin/ccache/$(MXE_TOOL_PREFIX)$$f; \
527 fi; \
528 done && \
529 for f in gcc g++ gfortran; do \
530 if test ! -e usr/bin/ccache/$$f; then \
531 ln -s /usr/bin/ccache usr/bin/ccache/$$f; \
532 fi; \
533 done
534
535 .PHONY: all-targets
536 all-targets: $(OCTAVE_TARGET)
511 537
512 .PHONY: all-packages 538 .PHONY: all-packages
513 all-packages: $(PKGS) 539 all-packages: $(PKGS)
514 540
515 $(PKGS): $(BUILD_TOOLS) cmake-toolchain-file.stamp 541 $(PKGS): $(BUILD_TOOLS) cmake-toolchain-file.stamp