From ff4eeebec270828b6d5971bbab4a33f0df62848b Mon Sep 17 00:00:00 2001 From: uz Date: Wed, 2 Dec 2009 15:21:22 +0000 Subject: [PATCH] Makefile patch contributed by Greg King: I added the "MAKEOPTS=" to the top-level "gcc.mak" that he wants, and I changed the tool source tree's top-level make-file so that it supports parallel building. (I added a rule that builds the common library before building anything else.) git-svn-id: svn://svn.cc65.org/cc65/trunk@4497 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- make/gcc.mak | 13 +++++++++---- src/make/gcc.mak | 35 ++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/make/gcc.mak b/make/gcc.mak index 5ae2eb854..6b858e219 100644 --- a/make/gcc.mak +++ b/make/gcc.mak @@ -14,6 +14,10 @@ #MAKEOVERRIDES= # (That trick has been disabled.) +# To compile with custom make-options, set them here; for example: +#MAKEOPTS = -j 2 CFLAGS=-O4 CC=clang +MAKEOPTS = + # The install prefix and directories prefix = /usr/local exec_prefix = $(prefix) @@ -58,9 +62,10 @@ endif all: bins libs docs $(SYS:%=samples tests) bins: - @$(MAKE) -C src -f make/gcc.mak CA65_INC=\\\"${CA65_INC}/\\\" \ - CC65_INC=\\\"${CC65_INC}/\\\" LD65_CFG=\\\"${LD65_CFG}/\\\" \ - LD65_LIB=\\\"${LD65_LIB}/\\\" LD65_OBJ=\\\"${LD65_OBJ}/\\\" + @$(MAKE) -C src -f make/gcc.mak $(MAKEOPTS) \ + CA65_INC=\\\"${CA65_INC}/\\\" CC65_INC=\\\"${CC65_INC}/\\\" \ + LD65_CFG=\\\"${LD65_CFG}/\\\" LD65_LIB=\\\"${LD65_LIB}/\\\" \ + LD65_OBJ=\\\"${LD65_OBJ}/\\\" libs: @$(MAKE) -C libsrc @@ -69,7 +74,7 @@ libs: # if a host system doesn't have LinuxDoc Tools. docs: @if linuxdoc -B check doc/index >/dev/null 2>&1; \ - then $(MAKE) -C doc html; \ + then $(MAKE) -C doc $(MAKEOPTS) html; \ else echo '"LinuxDoc Tools" is not installed; skipping HTML documentation.'; \ fi diff --git a/src/make/gcc.mak b/src/make/gcc.mak index f36162f2a..ccd1f3fa7 100644 --- a/src/make/gcc.mak +++ b/src/make/gcc.mak @@ -1,21 +1,26 @@ # # gcc Makefile for the program sources # - -SUBDIRS = \ - common \ - ar65 \ - ca65 \ - cc65 \ - chrcvt \ - cl65 \ - co65 \ - da65 \ - grc \ - ld65 \ +PROGS = \ + ar65 \ + ca65 \ + cc65 \ + chrcvt \ + cl65 \ + co65 \ + da65 \ + grc \ + ld65 \ od65 -.PHONY: all dist clean zap -all dist clean zap: - for i in $(SUBDIRS); do $(MAKE) -C $$i -f make/gcc.mak $@ || exit $$?; done +SUBDIRS = common $(PROGS) + +.PHONY: all dist clean zap $(SUBDIRS) +all dist clean zap: $(SUBDIRS) + +# Finish building the common library before allowing parallel makes. +$(PROGS): common + +$(SUBDIRS): + $(MAKE) -C $@ -f make/gcc.mak $(MAKECMDGOALS) -- 2.39.5