From 93f55c274b3fc88f26590b0fb104eca2f3da0c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Fri, 13 May 2016 14:28:58 +0200 Subject: [PATCH 01/10] moved output of target utils and drivers to separate directory --- doc/Makefile | 2 ++ libsrc/Makefile | 24 ++++++++++++++--------- libsrc/apple2/targetutil/Makefile.inc | 4 ++-- libsrc/atari/targetutil/Makefile.inc | 4 ++-- libsrc/geos-apple/targetutil/Makefile.inc | 4 ++-- libsrc/nes/Makefile.inc | 16 +++++++-------- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 967443ef0..8b0b316b0 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -41,7 +41,9 @@ ifeq ($(wildcard ../info),../info) endif zip: +ifneq "$(wildcard ../html)" "" @cd .. && zip cc65 html/*.* +endif doc: html info diff --git a/libsrc/Makefile b/libsrc/Makefile index a4101aecd..ae65dc9b6 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -37,12 +37,15 @@ DRVTYPES = emd \ ser \ tgi -OUTPUTDIRS := lib \ - $(DRVTYPES) \ - targetutil \ - asminc \ - cfg \ - include \ +DRVOUTPUTDIRS := $(foreach drvtype,$(DRVTYPES),goodies/drivers/$(drvtype)) + +OUTPUTDIRS := lib \ + $(DRVOUTPUTDIRS) \ + goodies/targetutil \ + asminc \ + cfg \ + include \ + samples \ $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*))) .PHONY: all mostlyclean clean install zip lib $(TARGETS) @@ -76,8 +79,11 @@ all lib: $(TARGETS) mostlyclean: $(call RMDIR,../libwrk) +# Transitional line active. Final line commented out below in order to +# allow some time for transition between the directory structures clean: - $(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES))) + $(call RMDIR,../libwrk ../lib ../targetutil ../goodies $(addprefix ../,$(DRVTYPES))) +# $(call RMDIR,../libwrk ../lib ../goodies) ifdef CMD_EXE @@ -212,7 +218,7 @@ define DRVTYPE_template $1_SRCDIR = $$(SRCDIR)/$1 $1_STCDIR = ../libwrk/$$(TARGET) $1_DYNDIR = ../libwrk/$$(TARGET)/$1 -$1_DRVDIR = ../$1 +$1_DRVDIR = ../goodies/drivers/$1 $1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s $1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o @@ -283,7 +289,7 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib $(AR65) a $@ $? -../libwrk/$(TARGET) ../lib ../targetutil: +../libwrk/$(TARGET) ../lib ../goodies/targetutil: @$(call MKDIR,$@) $(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib diff --git a/libsrc/apple2/targetutil/Makefile.inc b/libsrc/apple2/targetutil/Makefile.inc index 105a5324f..0b8b39e1f 100644 --- a/libsrc/apple2/targetutil/Makefile.inc +++ b/libsrc/apple2/targetutil/Makefile.inc @@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/loader.d ../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET) $(ASSEMBLE_recipe) -../targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil +../goodies/targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../goodies/targetutil $(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^) -$(TARGET): ../targetutil/loader.system +$(TARGET): ../goodies/targetutil/loader.system diff --git a/libsrc/atari/targetutil/Makefile.inc b/libsrc/atari/targetutil/Makefile.inc index 05405f2e6..42903a3ca 100644 --- a/libsrc/atari/targetutil/Makefile.inc +++ b/libsrc/atari/targetutil/Makefile.inc @@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/w2cas.d ../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET) $(COMPILE_recipe) -../targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../targetutil +../goodies/targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../goodies/targetutil $(LD65) -o $@ -t $(TARGET) $^ -$(TARGET): ../targetutil/w2cas.com +$(TARGET): ../goodies/targetutil/w2cas.com diff --git a/libsrc/geos-apple/targetutil/Makefile.inc b/libsrc/geos-apple/targetutil/Makefile.inc index fbe31981c..d842b4d3f 100644 --- a/libsrc/geos-apple/targetutil/Makefile.inc +++ b/libsrc/geos-apple/targetutil/Makefile.inc @@ -8,7 +8,7 @@ DEPS += ../libwrk/$(TARGET)/convert.d ../lib/apple2enh.lib: @$(MAKE) --no-print-directory apple2enh -../targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil +../goodies/targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../goodies/targetutil $(LD65) -o $@ -C apple2enh-system.cfg $^ -$(TARGET): ../targetutil/convert.system +$(TARGET): ../goodies/targetutil/convert.system diff --git a/libsrc/nes/Makefile.inc b/libsrc/nes/Makefile.inc index f1dcbf18e..aaebef1db 100644 --- a/libsrc/nes/Makefile.inc +++ b/libsrc/nes/Makefile.inc @@ -1,8 +1,8 @@ -../tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ - ../libwrk/nes/cputc.o \ - ../libwrk/nes/get_tv.o \ - ../libwrk/nes/gotoxy.o \ - ../libwrk/nes/popa.o \ - ../libwrk/nes/ppu.o \ - ../libwrk/nes/ppubuf.o \ - ../libwrk/nes/setcursor.o +../goodies/drivers/tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ + ../libwrk/nes/cputc.o \ + ../libwrk/nes/get_tv.o \ + ../libwrk/nes/gotoxy.o \ + ../libwrk/nes/popa.o \ + ../libwrk/nes/ppu.o \ + ../libwrk/nes/ppubuf.o \ + ../libwrk/nes/setcursor.o From ba10c74a7a2783fea88b24c41c5b8a84afe32570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 16 May 2016 19:49:43 +0200 Subject: [PATCH 02/10] directory structure changed from driver-centric to target-centric --- libsrc/Makefile | 14 ++++++-------- libsrc/apple2/targetutil/Makefile.inc | 4 ++-- libsrc/atari/targetutil/Makefile.inc | 4 ++-- libsrc/geos-apple/targetutil/Makefile.inc | 4 ++-- libsrc/nes/Makefile.inc | 16 ++++++++-------- samples/Makefile | 20 ++++++++++++-------- 6 files changed, 32 insertions(+), 30 deletions(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index ae65dc9b6..c4c1b78a7 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -1,3 +1,4 @@ + ifneq ($(shell echo),) CMD_EXE = 1 endif @@ -37,11 +38,8 @@ DRVTYPES = emd \ ser \ tgi -DRVOUTPUTDIRS := $(foreach drvtype,$(DRVTYPES),goodies/drivers/$(drvtype)) - OUTPUTDIRS := lib \ - $(DRVOUTPUTDIRS) \ - goodies/targetutil \ + target \ asminc \ cfg \ include \ @@ -82,8 +80,8 @@ mostlyclean: # Transitional line active. Final line commented out below in order to # allow some time for transition between the directory structures clean: - $(call RMDIR,../libwrk ../lib ../targetutil ../goodies $(addprefix ../,$(DRVTYPES))) -# $(call RMDIR,../libwrk ../lib ../goodies) + $(call RMDIR,../libwrk ../lib ../targetutil ../target $(addprefix ../,$(DRVTYPES))) +# $(call RMDIR,../libwrk ../lib ../target) ifdef CMD_EXE @@ -218,7 +216,7 @@ define DRVTYPE_template $1_SRCDIR = $$(SRCDIR)/$1 $1_STCDIR = ../libwrk/$$(TARGET) $1_DYNDIR = ../libwrk/$$(TARGET)/$1 -$1_DRVDIR = ../goodies/drivers/$1 +$1_DRVDIR = ../target/$$(TARGET)/drv/$1 $1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s $1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o @@ -289,7 +287,7 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib $(AR65) a $@ $? -../libwrk/$(TARGET) ../lib ../goodies/targetutil: +../libwrk/$(TARGET) ../lib ../target/$(TARGET)/util: @$(call MKDIR,$@) $(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib diff --git a/libsrc/apple2/targetutil/Makefile.inc b/libsrc/apple2/targetutil/Makefile.inc index 0b8b39e1f..d9d727b0a 100644 --- a/libsrc/apple2/targetutil/Makefile.inc +++ b/libsrc/apple2/targetutil/Makefile.inc @@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/loader.d ../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET) $(ASSEMBLE_recipe) -../goodies/targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../goodies/targetutil +../target/$(TARGET)/util/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../target/$(TARGET)/util $(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^) -$(TARGET): ../goodies/targetutil/loader.system +$(TARGET): ../target/$(TARGET)/util/loader.system diff --git a/libsrc/atari/targetutil/Makefile.inc b/libsrc/atari/targetutil/Makefile.inc index 42903a3ca..e78585238 100644 --- a/libsrc/atari/targetutil/Makefile.inc +++ b/libsrc/atari/targetutil/Makefile.inc @@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/w2cas.d ../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET) $(COMPILE_recipe) -../goodies/targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../goodies/targetutil +../target/$(TARGET)/util/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../target/$(TARGET)/util $(LD65) -o $@ -t $(TARGET) $^ -$(TARGET): ../goodies/targetutil/w2cas.com +$(TARGET): ../target/$(TARGET)/util/w2cas.com diff --git a/libsrc/geos-apple/targetutil/Makefile.inc b/libsrc/geos-apple/targetutil/Makefile.inc index d842b4d3f..3d366f913 100644 --- a/libsrc/geos-apple/targetutil/Makefile.inc +++ b/libsrc/geos-apple/targetutil/Makefile.inc @@ -8,7 +8,7 @@ DEPS += ../libwrk/$(TARGET)/convert.d ../lib/apple2enh.lib: @$(MAKE) --no-print-directory apple2enh -../goodies/targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../goodies/targetutil +../target/$(TARGET)/util/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../target/$(TARGET)/util $(LD65) -o $@ -C apple2enh-system.cfg $^ -$(TARGET): ../goodies/targetutil/convert.system +$(TARGET): ../target/$(TARGET)/util/convert.system diff --git a/libsrc/nes/Makefile.inc b/libsrc/nes/Makefile.inc index aaebef1db..6f2e7c7d2 100644 --- a/libsrc/nes/Makefile.inc +++ b/libsrc/nes/Makefile.inc @@ -1,8 +1,8 @@ -../goodies/drivers/tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ - ../libwrk/nes/cputc.o \ - ../libwrk/nes/get_tv.o \ - ../libwrk/nes/gotoxy.o \ - ../libwrk/nes/popa.o \ - ../libwrk/nes/ppu.o \ - ../libwrk/nes/ppubuf.o \ - ../libwrk/nes/setcursor.o +../target/nes/drv/tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ + ../libwrk/nes/cputc.o \ + ../libwrk/nes/get_tv.o \ + ../libwrk/nes/gotoxy.o \ + ../libwrk/nes/popa.o \ + ../libwrk/nes/ppu.o \ + ../libwrk/nes/ppubuf.o \ + ../libwrk/nes/setcursor.o diff --git a/samples/Makefile b/samples/Makefile index 951706ce6..0cef19798 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -12,15 +12,19 @@ SYS = c64 # source tree; otherwise, use the "install" directories. ifeq "$(wildcard ../src)" "" # No source tree -MOUS = /usr/lib/cc65/mou/$(SYS)*.mou -TGI = /usr/lib/cc65/tgi/$(SYS)*.tgi +MOUS = /usr/lib/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = /usr/lib/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi ifneq "$(wildcard /usr/local/lib/cc65)" "" -MOUS = /usr/local/lib/cc65/mou/$(SYS)*.mou -TGI = /usr/local/lib/cc65/tgi/$(SYS)*.tgi +MOUS = /usr/local/lib/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = /usr/local/lib/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi +endif +ifneq "$(wildcard /opt/local/share/cc65)" "" +MOUS = /opt/local/share/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = /opt/local/share/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi endif ifdef CC65_HOME -MOUS = $(CC65_HOME)/mou/$(SYS)*.mou -TGI = $(CC65_HOME)/tgi/$(SYS)*.tgi +MOUS = $(CC65_HOME)/target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = $(CC65_HOME)/target/$(SYS)/drv/tgi/$(SYS)*.tgi endif CLIB = --lib $(SYS).lib CL = cl65 @@ -31,8 +35,8 @@ LD = ld65 else # "samples/" is a part of a complete source tree. export CC65_HOME := $(abspath ..) -MOUS = ../mou/$(SYS)*.mou -TGI = ../tgi/$(SYS)*.tgi +MOUS = ../target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = ../target/$(SYS)/drv/tgi/$(SYS)*.tgi CLIB = ../lib/$(SYS).lib CL = ../bin/cl65 CC = ../bin/cc65 From a5bff259bc241fc33763ce51f125d887b2221440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 16 May 2016 19:50:02 +0200 Subject: [PATCH 03/10] Ignores adjusted --- .gitignore | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 196cdc3d7..e1f69d072 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,8 @@ /bin/ -/emd/ /html/ /info/ -/joy/ /lib/ /libwrk/ -/mou/ -/ser/ -/targetutil/ +/target/ /testwrk/ -/tgi/ /wrk/ From 37f992909416defbb34454137ff89705fb4f40ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 16 May 2016 22:14:05 +0200 Subject: [PATCH 04/10] adapted for zip/install targets --- libsrc/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index c4c1b78a7..54e0a7540 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -39,12 +39,13 @@ DRVTYPES = emd \ tgi OUTPUTDIRS := lib \ - target \ asminc \ cfg \ include \ samples \ - $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*))) + $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))\ + $(subst ../,,$(wildcard ../target/*/drv/*))\ + $(subst ../,,$(wildcard ../target/*/util))\ .PHONY: all mostlyclean clean install zip lib $(TARGETS) @@ -80,8 +81,8 @@ mostlyclean: # Transitional line active. Final line commented out below in order to # allow some time for transition between the directory structures clean: - $(call RMDIR,../libwrk ../lib ../targetutil ../target $(addprefix ../,$(DRVTYPES))) -# $(call RMDIR,../libwrk ../lib ../target) + $(call RMDIR,../libwrk ../lib ../targetutil ../$(TARGETDIR) $(addprefix ../,$(DRVTYPES))) +# $(call RMDIR,../libwrk ../lib ../$(TARGETDIR)) ifdef CMD_EXE @@ -95,13 +96,14 @@ define INSTALL_recipe $(if $(prefix),,$(error variable `prefix' must be set)) $(INSTALL) -d $(DESTDIR)$(datadir)/$(dir) -$(INSTALL) -m644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir) +$(INSTALL) -m0644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir) endef # INSTALL_recipe install: $(foreach dir,$(OUTPUTDIRS),$(INSTALL_recipe)) + endif # CMD_EXE define ZIP_recipe From 9c3f89fa1fb43336eb588aec7b8c367a788d9a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 16 May 2016 22:34:43 +0200 Subject: [PATCH 05/10] ignoring zip target output --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e1f69d072..dac38c48b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /target/ /testwrk/ /wrk/ +cc65.zip From cc747946b282b59d9e29ea1f5772172ac6ed7c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 16 May 2016 22:35:24 +0200 Subject: [PATCH 06/10] removed variable usage --- libsrc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/Makefile b/libsrc/Makefile index 54e0a7540..3f6d2746c 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -81,8 +81,8 @@ mostlyclean: # Transitional line active. Final line commented out below in order to # allow some time for transition between the directory structures clean: - $(call RMDIR,../libwrk ../lib ../targetutil ../$(TARGETDIR) $(addprefix ../,$(DRVTYPES))) -# $(call RMDIR,../libwrk ../lib ../$(TARGETDIR)) + $(call RMDIR,../libwrk ../lib ../targetutil ../target $(addprefix ../,$(DRVTYPES))) +# $(call RMDIR,../libwrk ../lib ../target) ifdef CMD_EXE From 759f5f5f486170db50148ffae5b95caffa240c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Wed, 18 May 2016 16:42:51 +0200 Subject: [PATCH 07/10] docs for targets with target utilities adjusted --- doc/apple2.sgml | 2 +- doc/apple2enh.sgml | 4 ++-- doc/atari.sgml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/apple2.sgml b/doc/apple2.sgml index b576ae6c1..00cd565b4 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -241,7 +241,7 @@ The easiest (and for really large programs in fact the only) way to have a cc65 program use the memory from $800 to $2000 is to link it as binary (as opposed to system) program using the default linker configuration with with diff --git a/doc/atari.sgml b/doc/atari.sgml index 2087a8541..cfa1937e0 100644 --- a/doc/atari.sgml +++ b/doc/atari.sgml @@ -229,8 +229,8 @@ for C and assembly language programs. The size of a cassette boot file is restricted to 32K. Larger programs would need to be split in more parts and the parts to be loaded manually. -To write the generated file to a cassette, a utility to run -on an Atari is provided in the From ac5bb6707d9ccfd2f586a0de7c2bb108e5811dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Sun, 29 May 2016 16:19:03 +0200 Subject: [PATCH 08/10] Post-review changes --- doc/Makefile | 4 ++-- libsrc/Makefile | 6 +----- libsrc/nes/Makefile.inc | 14 +++++++------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 8b0b316b0..862164e1b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -33,11 +33,11 @@ install: $(if $(prefix),,$(error variable `prefix' must be set)) ifeq ($(wildcard ../html),../html) $(INSTALL) -d $(DESTDIR)$(htmldir) - $(INSTALL) -m644 ../html/*.* $(DESTDIR)$(htmldir) + $(INSTALL) -m0644 ../html/*.* $(DESTDIR)$(htmldir) endif ifeq ($(wildcard ../info),../info) $(INSTALL) -d $(DESTDIR)$(infodir) - $(INSTALL) -m644 ../info/*.* $(DESTDIR)$(infodir) + $(INSTALL) -m0644 ../info/*.* $(DESTDIR)$(infodir) endif zip: diff --git a/libsrc/Makefile b/libsrc/Makefile index 3f6d2746c..549a7d4e9 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -78,11 +78,8 @@ all lib: $(TARGETS) mostlyclean: $(call RMDIR,../libwrk) -# Transitional line active. Final line commented out below in order to -# allow some time for transition between the directory structures clean: - $(call RMDIR,../libwrk ../lib ../targetutil ../target $(addprefix ../,$(DRVTYPES))) -# $(call RMDIR,../libwrk ../lib ../target) + $(call RMDIR,../libwrk ../lib ../target) ifdef CMD_EXE @@ -103,7 +100,6 @@ endef # INSTALL_recipe install: $(foreach dir,$(OUTPUTDIRS),$(INSTALL_recipe)) - endif # CMD_EXE define ZIP_recipe diff --git a/libsrc/nes/Makefile.inc b/libsrc/nes/Makefile.inc index 6f2e7c7d2..e23605781 100644 --- a/libsrc/nes/Makefile.inc +++ b/libsrc/nes/Makefile.inc @@ -1,8 +1,8 @@ ../target/nes/drv/tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ - ../libwrk/nes/cputc.o \ - ../libwrk/nes/get_tv.o \ - ../libwrk/nes/gotoxy.o \ - ../libwrk/nes/popa.o \ - ../libwrk/nes/ppu.o \ - ../libwrk/nes/ppubuf.o \ - ../libwrk/nes/setcursor.o + ../libwrk/nes/cputc.o \ + ../libwrk/nes/get_tv.o \ + ../libwrk/nes/gotoxy.o \ + ../libwrk/nes/popa.o \ + ../libwrk/nes/ppu.o \ + ../libwrk/nes/ppubuf.o \ + ../libwrk/nes/setcursor.o From e36a636eee796466242874507fa3712b504f08ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Sun, 29 May 2016 16:34:22 +0200 Subject: [PATCH 09/10] Indenting optimised --- libsrc/nes/Makefile.inc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libsrc/nes/Makefile.inc b/libsrc/nes/Makefile.inc index e23605781..ee43b4ff8 100644 --- a/libsrc/nes/Makefile.inc +++ b/libsrc/nes/Makefile.inc @@ -1,8 +1,9 @@ -../target/nes/drv/tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ - ../libwrk/nes/cputc.o \ - ../libwrk/nes/get_tv.o \ - ../libwrk/nes/gotoxy.o \ - ../libwrk/nes/popa.o \ - ../libwrk/nes/ppu.o \ - ../libwrk/nes/ppubuf.o \ - ../libwrk/nes/setcursor.o +../target/nes/drv/tgi/nes-64-56-2.tgi: \ + ../libwrk/nes/clrscr.o \ + ../libwrk/nes/cputc.o \ + ../libwrk/nes/get_tv.o \ + ../libwrk/nes/gotoxy.o \ + ../libwrk/nes/popa.o \ + ../libwrk/nes/ppu.o \ + ../libwrk/nes/ppubuf.o \ + ../libwrk/nes/setcursor.o From 4dcfc036c8d29a9c57f3181931448027aeea0ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycjusz=20R=2E=20=C5=81ogiewa?= Date: Mon, 30 May 2016 17:42:01 +0200 Subject: [PATCH 10/10] samples zip and install targets moved into samples/Makefile as agreed --- Makefile | 17 +++++++++-------- libsrc/Makefile | 1 - samples/Makefile | 49 ++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 48 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index e0530e9f0..a10df8db0 100644 --- a/Makefile +++ b/Makefile @@ -3,21 +3,22 @@ .SUFFIXES: all mostlyclean clean install zip: - @$(MAKE) -C src --no-print-directory $@ - @$(MAKE) -C libsrc --no-print-directory $@ - @$(MAKE) -C doc --no-print-directory $@ + @$(MAKE) -C src --no-print-directory $@ + @$(MAKE) -C libsrc --no-print-directory $@ + @$(MAKE) -C doc --no-print-directory $@ + @$(MAKE) -C samples --no-print-directory $@ avail unavail bin: - @$(MAKE) -C src --no-print-directory $@ + @$(MAKE) -C src --no-print-directory $@ lib: - @$(MAKE) -C libsrc --no-print-directory $@ + @$(MAKE) -C libsrc --no-print-directory $@ doc: - @$(MAKE) -C doc --no-print-directory $@ + @$(MAKE) -C doc --no-print-directory $@ %65: - @$(MAKE) -C src --no-print-directory $@ + @$(MAKE) -C src --no-print-directory $@ %: - @$(MAKE) -C libsrc --no-print-directory $@ + @$(MAKE) -C libsrc --no-print-directory $@ diff --git a/libsrc/Makefile b/libsrc/Makefile index 549a7d4e9..99f120f3a 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -42,7 +42,6 @@ OUTPUTDIRS := lib \ asminc \ cfg \ include \ - samples \ $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))\ $(subst ../,,$(wildcard ../target/*/drv/*))\ $(subst ../,,$(wildcard ../target/*/util))\ diff --git a/samples/Makefile b/samples/Makefile index 0cef19798..d9b51e827 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -12,20 +12,19 @@ SYS = c64 # source tree; otherwise, use the "install" directories. ifeq "$(wildcard ../src)" "" # No source tree -MOUS = /usr/lib/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou -TGI = /usr/lib/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi +installdir = /usr/lib/cc65 ifneq "$(wildcard /usr/local/lib/cc65)" "" -MOUS = /usr/local/lib/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou -TGI = /usr/local/lib/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi +installdir = /usr/local/lib/cc65 endif ifneq "$(wildcard /opt/local/share/cc65)" "" -MOUS = /opt/local/share/cc65/target/$(SYS)/drv/mou/$(SYS)*.mou -TGI = /opt/local/share/cc65/target/$(SYS)/drv/tgi/$(SYS)*.tgi +installdir = /opt/local/share/cc65 endif ifdef CC65_HOME -MOUS = $(CC65_HOME)/target/$(SYS)/drv/mou/$(SYS)*.mou -TGI = $(CC65_HOME)/target/$(SYS)/drv/tgi/$(SYS)*.tgi +installdir = $(CC65_HOME) endif + +MOUS = $(installdir)/target/$(SYS)/drv/mou/$(SYS)*.mou +TGI = $(installdir)/target/$(SYS)/drv/tgi/$(SYS)*.tgi CLIB = --lib $(SYS).lib CL = cl65 CC = cc65 @@ -109,8 +108,11 @@ EXELIST = ascii \ # -------------------------------------------------------------------------- # Rules to make the binaries -.PHONY: all -all: $(EXELIST) +.PHONY: all samples +all: + +samples: + $(EXELIST) # -------------------------------------------------------------------------- # Overlay rules. Overlays need special ld65 configuration files. Also, the @@ -138,9 +140,36 @@ samples.d64: all $(C1541) -attach $@ -write $$mod > /dev/null || exit $$?;\ done +# -------------------------------------------------------------------------- +# Installation rules + +INSTALL = install +samplesdir = $(prefix)/share/cc65 +.PHONY: install +install: + $(if $(prefix),,$(error variable `prefix' must be set)) + $(INSTALL) -d $(DESTDIR)$(samplesdir) + $(INSTALL) -d $(DESTDIR)$(samplesdir)/geos + $(INSTALL) -d $$(DESTDIR)$(samplesdir)/tutorial + $(INSTALL) -m0644 *.* $(DESTDIR)$(samplesdir) + $(INSTALL) -m0644 README $(DESTDIR)$(samplesdir) + $(INSTALL) -m0644 Makefile $(DESTDIR)$(samplesdir) + $(INSTALL) -m0644 geos/*.* $(DESTDIR)$(samplesdir)/geos + $(INSTALL) -m0644 tutorial/*.* $(DESTDIR)$(samplesdir)/tutorial + +# -------------------------------------------------------------------------- +# Packaging rules + +.PHONY: zip +zip: + @cd .. && zip -r cc65 samples/ + # -------------------------------------------------------------------------- # Clean-up rules +.PHONY: mostlyclean +mostlyclean: + .PHONY: clean clean: $(RM) *~ *.map *.o *.s *.lbl