#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)
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
# 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
#
# 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)