From c9e9679a06afd86fe8caeb32177c11736b98a974 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Sun, 19 Jun 2016 18:55:00 +0200 Subject: [PATCH] Improved doc and samples default target. The 'all' target deliberately doesn't build the doc nor the samples. But that doesn't mean that the Makefiles in the 'doc' and 'samples' directories must default to the (empty) 'all' target. --- doc/Makefile | 42 +++++++++++++++++++++--------------------- samples/Makefile | 9 +++++---- samples/README | 4 ++-- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 862164e1b..96a3ba59b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -9,11 +9,9 @@ endif htmldir = $(prefix)/share/doc/cc65$(DESTPACKAGE_SUFFIX)/html infodir = $(prefix)/share/info -all mostlyclean: - ifdef CMD_EXE -clean install zip doc: +doc clean install zip: else # CMD_EXE @@ -26,6 +24,24 @@ TOC_LEVEL = 2 INSTALL = install +doc: html info + +html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) + +info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) + +../html ../info: + @mkdir $@ + +../html/%.html: %.sgml header.html | ../html + @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< + +../html/doc.%: doc.% | ../html + cp $< ../html + +../info/%.info: %.sgml | ../info + @cd ../info && linuxdoc -B info ../doc/$< + clean: $(RM) -r ../html ../info @@ -45,22 +61,6 @@ ifneq "$(wildcard ../html)" "" @cd .. && zip cc65 html/*.* endif -doc: html info - -html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png) - -info: $(addprefix ../info/,$(SGMLS:.sgml=.info)) - -../html ../info: - @mkdir $@ - -../html/%.html: %.sgml header.html | ../html - @cd ../html && linuxdoc -B html -s 0 -T $(TOC_LEVEL) -H ../doc/header.html ../doc/$< - -../html/doc.%: doc.% | ../html - cp $< ../html - -../info/%.info: %.sgml | ../info - @cd ../info && linuxdoc -B info ../doc/$< - endif # CMD_EXE + +all mostlyclean: diff --git a/samples/Makefile b/samples/Makefile index bbf69c820..fc88d94b7 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -4,8 +4,9 @@ # This Makefile requires GNU make # -# Run 'make samples SYS=' to build for another target system -SYS = c64 +# Run 'make SYS=' or set a SYS env +# var to build for another target system. +SYS ?= c64 ifneq ($(shell echo),) CMD_EXE = 1 @@ -147,12 +148,12 @@ EXELIST_atarixl = $(EXELIST_atari) # -------------------------------------------------------------------------- # Rules to make the binaries and the disk -all: - samples: $(EXELIST_$(SYS)) disk: $(DISK_$(SYS)) +all: + # -------------------------------------------------------------------------- # Overlay rules. Overlays need special ld65 configuration files. Also, the # overlay file-names are shortenned to fit the Atari's 8.3-character limit. diff --git a/samples/README b/samples/README index b7476e354..a576c4032 100644 --- a/samples/README +++ b/samples/README @@ -12,8 +12,8 @@ Please note: * The makefile specifies the C64 as the default target system, because all but one of the programs run on this platform. When compiling for another system, you will have to change the line that specifies the target system - at the top of the makefile or specify the system with SYS= on the - make command line. + at the top of the makefile, specify the system with SYS= on the + make command line or set a SYS env var. List of supplied sample programs: -- 2.39.5