]> git.sur5r.net Git - cc65/commitdiff
samples zip and install targets moved into samples/Makefile as agreed 287/head
authorPatrycjusz R. Łogiewa <patrycjusz.logiewa@srebrnysen.com>
Mon, 30 May 2016 15:42:01 +0000 (17:42 +0200)
committerPatrycjusz R. Łogiewa <patrycjusz.logiewa@srebrnysen.com>
Mon, 30 May 2016 15:42:01 +0000 (17:42 +0200)
Makefile
libsrc/Makefile
samples/Makefile

index e0530e9f073b3b5ab50f7d5f0ccedc8378ae855e..a10df8db09a57ee1cb5d5ed5ff0e8e556be4a9d3 100644 (file)
--- 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 $@
index 549a7d4e9531714450ecdfa6d38d292dfa866205..99f120f3afdcbf81e0e6588d2c4ca41a8634da4d 100644 (file)
@@ -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))\
index 0cef197988705f96642baf522bec915929223267..d9b51e827a6ba3269d142839bdb921a556628a06 100644 (file)
@@ -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