1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-10 19:29:45 +00:00

Merge pull request #287 from silverdr/target_goodies

moved output of target utils and drivers to separate directory
This commit is contained in:
Oliver Schmidt 2016-06-01 11:01:56 +02:00
commit 89329f1519
12 changed files with 90 additions and 56 deletions

8
.gitignore vendored
View File

@ -1,13 +1,9 @@
/bin/ /bin/
/emd/
/html/ /html/
/info/ /info/
/joy/
/lib/ /lib/
/libwrk/ /libwrk/
/mou/ /target/
/ser/
/targetutil/
/testwrk/ /testwrk/
/tgi/
/wrk/ /wrk/
cc65.zip

View File

@ -6,6 +6,7 @@ all mostlyclean clean install zip:
@$(MAKE) -C src --no-print-directory $@ @$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@ @$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@ @$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
avail unavail bin: avail unavail bin:
@$(MAKE) -C src --no-print-directory $@ @$(MAKE) -C src --no-print-directory $@

View File

@ -33,15 +33,17 @@ install:
$(if $(prefix),,$(error variable `prefix' must be set)) $(if $(prefix),,$(error variable `prefix' must be set))
ifeq ($(wildcard ../html),../html) ifeq ($(wildcard ../html),../html)
$(INSTALL) -d $(DESTDIR)$(htmldir) $(INSTALL) -d $(DESTDIR)$(htmldir)
$(INSTALL) -m644 ../html/*.* $(DESTDIR)$(htmldir) $(INSTALL) -m0644 ../html/*.* $(DESTDIR)$(htmldir)
endif endif
ifeq ($(wildcard ../info),../info) ifeq ($(wildcard ../info),../info)
$(INSTALL) -d $(DESTDIR)$(infodir) $(INSTALL) -d $(DESTDIR)$(infodir)
$(INSTALL) -m644 ../info/*.* $(DESTDIR)$(infodir) $(INSTALL) -m0644 ../info/*.* $(DESTDIR)$(infodir)
endif endif
zip: zip:
ifneq "$(wildcard ../html)" ""
@cd .. && zip cc65 html/*.* @cd .. && zip cc65 html/*.*
endif
doc: html info doc: html info

View File

@ -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 program use the memory from $800 to $2000 is to link it as binary
(as opposed to system) program using the default linker configuration (as opposed to system) program using the default linker configuration
<ref id="apple-def-cfg" name="apple2.cfg"> with <tt/__HIMEM__/ set to &dollar;BF00 <ref id="apple-def-cfg" name="apple2.cfg"> with <tt/__HIMEM__/ set to &dollar;BF00
and load it with the targetutil LOADER.SYSTEM. The program then works like a system and load it with the LOADER.SYSTEM utility. The program then works like a system
program (i.e. quits to the ProDOS dispatcher). program (i.e. quits to the ProDOS dispatcher).
Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the

View File

@ -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 &dollar;800 to &dollar;2000 is to link it as binary program use the memory from &dollar;800 to &dollar;2000 is to link it as binary
(as opposed to system) program using the default linker configuration (as opposed to system) program using the default linker configuration
<ref id="apple-def-cfg" name="apple2enh.cfg"> with <tt/__HIMEM__/set to &dollar;BF00 <ref id="apple-def-cfg" name="apple2enh.cfg"> with <tt/__HIMEM__/set to &dollar;BF00
and load it with the targetutil LOADER.SYSTEM. The program then works like a system and load it with the LOADER.SYSTEM utility. The program then works like a system
program (i.e. quits to the ProDOS dispatcher). program (i.e. quits to the ProDOS dispatcher).
Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the

View File

@ -229,8 +229,8 @@ for C and assembly language programs.
The size of a cassette boot file is restricted to 32K. Larger 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. 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 To write the generated file to a cassette, a utility (<tt/w2cas.com/) to run
on an Atari is provided in the <tt/targetutil/ directory (<tt/w2cas.com/). on an Atari is provided in the <tt/util/ directory of <tt/atari/ target dir.
<sect1><tt/atarixl/ config files<p> <sect1><tt/atarixl/ config files<p>

View File

@ -1,3 +1,4 @@
ifneq ($(shell echo),) ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE = 1
endif endif
@ -38,12 +39,12 @@ DRVTYPES = emd \
tgi tgi
OUTPUTDIRS := lib \ OUTPUTDIRS := lib \
$(DRVTYPES) \
targetutil \
asminc \ asminc \
cfg \ cfg \
include \ include \
$(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) .PHONY: all mostlyclean clean install zip lib $(TARGETS)
@ -77,7 +78,7 @@ mostlyclean:
$(call RMDIR,../libwrk) $(call RMDIR,../libwrk)
clean: clean:
$(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES))) $(call RMDIR,../libwrk ../lib ../target)
ifdef CMD_EXE ifdef CMD_EXE
@ -91,7 +92,7 @@ define INSTALL_recipe
$(if $(prefix),,$(error variable `prefix' must be set)) $(if $(prefix),,$(error variable `prefix' must be set))
$(INSTALL) -d $(DESTDIR)$(datadir)/$(dir) $(INSTALL) -d $(DESTDIR)$(datadir)/$(dir)
$(INSTALL) -m644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir) $(INSTALL) -m0644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir)
endef # INSTALL_recipe endef # INSTALL_recipe
@ -212,7 +213,7 @@ define DRVTYPE_template
$1_SRCDIR = $$(SRCDIR)/$1 $1_SRCDIR = $$(SRCDIR)/$1
$1_STCDIR = ../libwrk/$$(TARGET) $1_STCDIR = ../libwrk/$$(TARGET)
$1_DYNDIR = ../libwrk/$$(TARGET)/$1 $1_DYNDIR = ../libwrk/$$(TARGET)/$1
$1_DRVDIR = ../$1 $1_DRVDIR = ../target/$$(TARGET)/drv/$1
$1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s $1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s
$1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o $1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o
@ -283,7 +284,7 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
../lib/$(TARGET).lib: $(OBJS) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR65) a $@ $? $(AR65) a $@ $?
../libwrk/$(TARGET) ../lib ../targetutil: ../libwrk/$(TARGET) ../lib ../target/$(TARGET)/util:
@$(call MKDIR,$@) @$(call MKDIR,$@)
$(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib $(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib

View File

@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/loader.d
../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET) ../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET)
$(ASSEMBLE_recipe) $(ASSEMBLE_recipe)
../targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../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,$^) $(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^)
$(TARGET): ../targetutil/loader.system $(TARGET): ../target/$(TARGET)/util/loader.system

View File

@ -3,7 +3,7 @@ DEPS += ../libwrk/$(TARGET)/w2cas.d
../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET) ../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET)
$(COMPILE_recipe) $(COMPILE_recipe)
../targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../targetutil ../target/$(TARGET)/util/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../target/$(TARGET)/util
$(LD65) -o $@ -t $(TARGET) $^ $(LD65) -o $@ -t $(TARGET) $^
$(TARGET): ../targetutil/w2cas.com $(TARGET): ../target/$(TARGET)/util/w2cas.com

View File

@ -8,7 +8,7 @@ DEPS += ../libwrk/$(TARGET)/convert.d
../lib/apple2enh.lib: ../lib/apple2enh.lib:
@$(MAKE) --no-print-directory apple2enh @$(MAKE) --no-print-directory apple2enh
../targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil ../target/$(TARGET)/util/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../target/$(TARGET)/util
$(LD65) -o $@ -C apple2enh-system.cfg $^ $(LD65) -o $@ -C apple2enh-system.cfg $^
$(TARGET): ../targetutil/convert.system $(TARGET): ../target/$(TARGET)/util/convert.system

View File

@ -1,4 +1,5 @@
../tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \ ../target/nes/drv/tgi/nes-64-56-2.tgi: \
../libwrk/nes/clrscr.o \
../libwrk/nes/cputc.o \ ../libwrk/nes/cputc.o \
../libwrk/nes/get_tv.o \ ../libwrk/nes/get_tv.o \
../libwrk/nes/gotoxy.o \ ../libwrk/nes/gotoxy.o \

View File

@ -12,16 +12,19 @@ SYS = c64
# source tree; otherwise, use the "install" directories. # source tree; otherwise, use the "install" directories.
ifeq "$(wildcard ../src)" "" ifeq "$(wildcard ../src)" ""
# No source tree # No source tree
MOUS = /usr/lib/cc65/mou/$(SYS)*.mou installdir = /usr/lib/cc65
TGI = /usr/lib/cc65/tgi/$(SYS)*.tgi
ifneq "$(wildcard /usr/local/lib/cc65)" "" ifneq "$(wildcard /usr/local/lib/cc65)" ""
MOUS = /usr/local/lib/cc65/mou/$(SYS)*.mou installdir = /usr/local/lib/cc65
TGI = /usr/local/lib/cc65/tgi/$(SYS)*.tgi endif
ifneq "$(wildcard /opt/local/share/cc65)" ""
installdir = /opt/local/share/cc65
endif endif
ifdef CC65_HOME ifdef CC65_HOME
MOUS = $(CC65_HOME)/mou/$(SYS)*.mou installdir = $(CC65_HOME)
TGI = $(CC65_HOME)/tgi/$(SYS)*.tgi
endif endif
MOUS = $(installdir)/target/$(SYS)/drv/mou/$(SYS)*.mou
TGI = $(installdir)/target/$(SYS)/drv/tgi/$(SYS)*.tgi
CLIB = --lib $(SYS).lib CLIB = --lib $(SYS).lib
CL = cl65 CL = cl65
CC = cc65 CC = cc65
@ -31,8 +34,8 @@ LD = ld65
else else
# "samples/" is a part of a complete source tree. # "samples/" is a part of a complete source tree.
export CC65_HOME := $(abspath ..) export CC65_HOME := $(abspath ..)
MOUS = ../mou/$(SYS)*.mou MOUS = ../target/$(SYS)/drv/mou/$(SYS)*.mou
TGI = ../tgi/$(SYS)*.tgi TGI = ../target/$(SYS)/drv/tgi/$(SYS)*.tgi
CLIB = ../lib/$(SYS).lib CLIB = ../lib/$(SYS).lib
CL = ../bin/cl65 CL = ../bin/cl65
CC = ../bin/cc65 CC = ../bin/cc65
@ -105,8 +108,11 @@ EXELIST = ascii \
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Rules to make the binaries # Rules to make the binaries
.PHONY: all .PHONY: all samples
all: $(EXELIST) all:
samples:
$(EXELIST)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Overlay rules. Overlays need special ld65 configuration files. Also, the # Overlay rules. Overlays need special ld65 configuration files. Also, the
@ -134,9 +140,36 @@ samples.d64: all
$(C1541) -attach $@ -write $$mod > /dev/null || exit $$?;\ $(C1541) -attach $@ -write $$mod > /dev/null || exit $$?;\
done 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 # Clean-up rules
.PHONY: mostlyclean
mostlyclean:
.PHONY: clean .PHONY: clean
clean: clean:
$(RM) *~ *.map *.o *.s *.lbl $(RM) *~ *.map *.o *.s *.lbl