1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-09 22:29:35 +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/
/emd/
/html/
/info/
/joy/
/lib/
/libwrk/
/mou/
/ser/
/targetutil/
/target/
/testwrk/
/tgi/
/wrk/
cc65.zip

View File

@ -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 $@

View File

@ -33,15 +33,17 @@ 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:
ifneq "$(wildcard ../html)" ""
@cd .. && zip cc65 html/*.*
endif
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
(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
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).
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
(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
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).
Using LOADER.SYSTEM is as simple as copying it to the ProDOS 8 directory of the
@ -277,7 +277,7 @@ default I/O buffer allocation basically yields the same placement of I/O buffers
in memory the primary benefit of <tt/apple2enh-iobuf-0800.o/ is a reduction in code
size - and thus program file size - of more than 1400 bytes.
Using <tt/apple2enh-iobuf-0800.o/ is as simple as placing it on the linker command
Using <tt/apple2enh-iobuf-0800.o/ is as simple as placing it on the linker command
line like this:
<tscreen><verb>

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
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 <tt/targetutil/ directory (<tt/w2cas.com/).
To write the generated file to a cassette, a utility (<tt/w2cas.com/) to run
on an Atari is provided in the <tt/util/ directory of <tt/atari/ target dir.
<sect1><tt/atarixl/ config files<p>

View File

@ -1,3 +1,4 @@
ifneq ($(shell echo),)
CMD_EXE = 1
endif
@ -37,13 +38,13 @@ DRVTYPES = emd \
ser \
tgi
OUTPUTDIRS := lib \
$(DRVTYPES) \
targetutil \
asminc \
cfg \
include \
$(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))
OUTPUTDIRS := lib \
asminc \
cfg \
include \
$(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))\
$(subst ../,,$(wildcard ../target/*/drv/*))\
$(subst ../,,$(wildcard ../target/*/util))\
.PHONY: all mostlyclean clean install zip lib $(TARGETS)
@ -77,7 +78,7 @@ mostlyclean:
$(call RMDIR,../libwrk)
clean:
$(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
$(call RMDIR,../libwrk ../lib ../target)
ifdef CMD_EXE
@ -91,7 +92,7 @@ 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
@ -212,7 +213,7 @@ define DRVTYPE_template
$1_SRCDIR = $$(SRCDIR)/$1
$1_STCDIR = ../libwrk/$$(TARGET)
$1_DYNDIR = ../libwrk/$$(TARGET)/$1
$1_DRVDIR = ../$1
$1_DRVDIR = ../target/$$(TARGET)/drv/$1
$1_SRCPAT = $$($1_SRCDIR)/$$(OBJPFX)%.s
$1_STCPAT = $$($1_STCDIR)/$$(OBJPFX)%-$1.o
@ -283,7 +284,7 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR65) a $@ $?
../libwrk/$(TARGET) ../lib ../targetutil:
../libwrk/$(TARGET) ../lib ../target/$(TARGET)/util:
@$(call MKDIR,$@)
$(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)
$(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,$^)
$(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)
$(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) $^
$(TARGET): ../targetutil/w2cas.com
$(TARGET): ../target/$(TARGET)/util/w2cas.com

View File

@ -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
../target/$(TARGET)/util/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../target/$(TARGET)/util
$(LD65) -o $@ -C apple2enh-system.cfg $^
$(TARGET): ../targetutil/convert.system
$(TARGET): ../target/$(TARGET)/util/convert.system

View File

@ -1,8 +1,9 @@
../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

View File

@ -12,16 +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
installdir = /usr/lib/cc65
ifneq "$(wildcard /usr/local/lib/cc65)" ""
MOUS = /usr/local/lib/cc65/mou/$(SYS)*.mou
TGI = /usr/local/lib/cc65/tgi/$(SYS)*.tgi
installdir = /usr/local/lib/cc65
endif
ifneq "$(wildcard /opt/local/share/cc65)" ""
installdir = /opt/local/share/cc65
endif
ifdef CC65_HOME
MOUS = $(CC65_HOME)/mou/$(SYS)*.mou
TGI = $(CC65_HOME)/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
@ -31,8 +34,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
@ -105,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
@ -134,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