.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 $@
# 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
# --------------------------------------------------------------------------
# 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
$(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