Skip to content

Commit

Permalink
Support non-GNU `make'
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Aug 13, 2013
1 parent 35608b3 commit 1cd844d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
5 changes: 4 additions & 1 deletion INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,15 @@ Building Installers
To build distribution installers, do not use `make in-place' or just
`make', but instead start from a clean repository.

Use one non-Windows machine as a server, where packages will be
Use one non-Windows machine as a server[*], where packages will be
pre-built. Then, create platform-specific installers on N client
machines, each of which contacts the server machine to obtain
pre-built packages. The server can act as a client, naturally, to
create an installer for the server's platform.

[*] GNU `make' is required on the server machine, but any `make'
should work on client machines.

Running Build Farms
-------------------

Expand Down
40 changes: 26 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ LINK_MODE = --save
CPUS =

in-place:
if [ "$(CPUS)" = "" ] ; then $(MAKE) plain-in-place ; else $(MAKE) cpus-in-place ; fi
if [ "$(CPUS)" = "" ] ; \
then $(MAKE) plain-in-place PKGS="$(PKGS)" ; \
else $(MAKE) cpus-in-place PKGS="$(PKGS)" ; fi

cpus-in-place:
$(MAKE) -j $(CPUS) plain-in-place JOB_OPTIONS="-j $(CPUS)"
$(MAKE) -j $(CPUS) plain-in-place JOB_OPTIONS="-j $(CPUS)" PKGS="$(PKGS)"

# Explicitly propagate variables for non-GNU `make's:
PKG_LINK_COPY_ARGS = PKGS="$(PKGS)" LINK_MODE="$(LINK_MODE)"

plain-in-place:
$(MAKE) base
if $(MACOSX_CHECK) ; then $(MAKE) native-from-git ; fi
$(MAKE) pkg-links LINK_MODE="$(LINK_MODE)"
$(MAKE) pkg-links $(PKG_LINK_COPY_ARGS)
$(PLAIN_RACKET) -N raco -l- raco setup $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)

win32-in-place:
$(MAKE) win32-base
$(MAKE) win32-pkg-links PKGS="$(PKGS)" LINK_MODE="$(LINK_MODE)"
$(MAKE) win32-pkg-links $(PKG_LINK_COPY_ARGS)
$(WIN32_PLAIN_RACKET) -N raco -l- raco setup $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)

again:
Expand Down Expand Up @@ -218,6 +223,9 @@ win32-pkg-links:
# ------------------------------------------------------------
# On a server platform (for an installer build):

# These targets require GNU `make', so that we don't have to propagate
# variables through all of the target layers.

server:
$(MAKE) base
$(MAKE) server-from-base
Expand All @@ -228,7 +236,9 @@ build/site.rkt:
echo "(machine)" >> build/site.rkt

stamp:
if [ "$(BUILD_STAMP)" = '' ] ; then $(MAKE) stamp-as-inferred ; else $(MAKE) stamp-as-given ; fi
if [ "$(BUILD_STAMP)" = '' ] ; \
then $(MAKE) stamp-as-inferred ; \
else $(MAKE) stamp-as-given ; fi
stamp-as-given:
echo "$(BUILD_STAMP)" > build/stamp.txt
stamp-as-inferred:
Expand All @@ -241,7 +251,9 @@ stamp-from-date:
local-from-base:
$(MAKE) build/site.rkt
$(MAKE) stamp
if [ "$(SRC_CATALOG)" = 'local' ] ; then $(MAKE) build-from-local ; else $(MAKE) build-from-catalog ; fi
if [ "$(SRC_CATALOG)" = 'local' ] ; \
then $(MAKE) build-from-local ; \
else $(MAKE) build-from-catalog ; fi

server-from-base:
$(MAKE) local-from-base
Expand Down Expand Up @@ -350,14 +362,6 @@ binary-catalog-server:
# keep the "build/user" directory on the grounds that the
# client is the same as the server.

client:
if [ ! -d build/log ] ; then rm -rf build/user ; fi
$(MAKE) base
$(MAKE) distro-build-from-server
$(MAKE) bundle-from-server
$(MAKE) bundle-config
$(MAKE) installer-from-bundle

COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" BUILD_STAMP="$(BUILD_STAMP)" \
RELEASE_MODE=$(RELEASE_MODE) SOURCE_MODE=$(SOURCE_MODE) \
PKG_SOURCE_MODE=$(PKG_SOURCE_MODE) INSTALL_NAME="$(INSTALL_NAME)"\
Expand All @@ -366,6 +370,14 @@ COPY_ARGS = SERVER=$(SERVER) PKGS="$(PKGS)" BUILD_STAMP="$(BUILD_STAMP)" \
DIST_DESC="$(DIST_DESC)" README="$(README)" \
JOB_OPTIONS="$(JOB_OPTIONS)"

client:
if [ ! -d build/log ] ; then rm -rf build/user ; fi
$(MAKE) base $(COPY_ARGS)
$(MAKE) distro-build-from-server $(COPY_ARGS)
$(MAKE) bundle-from-server $(COPY_ARGS)
$(MAKE) bundle-config $(COPY_ARGS)
$(MAKE) installer-from-bundle $(COPY_ARGS)

SET_BUNDLE_CONFIG_q = $(BUNDLE_CONFIG) "" "" "$(INSTALL_NAME)" "$(BUILD_STAMP)" "$(DOC_SEARCH)" $(DIST_CATALOGS_q)

win32-client:
Expand Down

0 comments on commit 1cd844d

Please sign in to comment.