]> git.sur5r.net Git - cc65/blobdiff - libsrc/Makefile
Merge pull request #112 from greg-king5/warnings
[cc65] / libsrc / Makefile
index 24a958972cef13e05c8d97c301c197e1e2806718..f7afd498f25ecdc137760d39bc32db748d919f1a 100644 (file)
@@ -2,10 +2,6 @@ ifneq ($(shell echo),)
   CMD_EXE = 1
 endif
 
-.PHONY: all mostlyclean clean install lib $(TARGETS)
-
-.SUFFIXES:
-
 CBMS = c128   \
        c16    \
        c64    \
@@ -37,6 +33,18 @@ DRVTYPES = emd \
            ser \
            tgi
 
+OUTPUTDIRS := lib         \
+              $(DRVTYPES) \
+              targetutil  \
+              asminc      \
+              cfg         \
+              include     \
+              $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))
+
+.PHONY: all mostlyclean clean install zip lib $(TARGETS)
+
+.SUFFIXES:
+
 ifdef CMD_EXE
   DIRLIST = $(strip $(foreach dir,$1,$(wildcard $(dir))))
   MKDIR = mkdir $(subst /,\,$1)
@@ -75,23 +83,28 @@ else # CMD_EXE
 
 INSTALL = install
 
-INSTALLDIRS = ../asminc ../cfg ../include \
-              $(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)) \
-              ../lib ../targetutil $(addprefix ../,$(DRVTYPES))
-
 define INSTALL_recipe
 
 $(if $(prefix),,$(error variable `prefix' must be set))
-$(INSTALL) -d $(subst ..,$(DESTDIR)$(datadir),$(dir))
-$(INSTALL) -m644 $(dir)/*.* $(subst ..,$(DESTDIR)$(datadir),$(dir))
+$(INSTALL) -d $(DESTDIR)$(datadir)/$(dir)
+$(INSTALL) -m644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir)
 
 endef # INSTALL_recipe
 
 install:
-       $(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
+       $(foreach dir,$(OUTPUTDIRS),$(INSTALL_recipe))
 
 endif # CMD_EXE
 
+define ZIP_recipe
+
+@cd .. && zip cc65 $(dir)/*.*
+
+endef # ZIP_recipe
+
+zip:
+       $(foreach dir,$(OUTPUTDIRS),$(ZIP_recipe))
+
 $(TARGETS):
        @$(MAKE) --no-print-directory $@
 
@@ -240,14 +253,14 @@ export CC65_HOME := $(abspath ..)
 
 define ASSEMBLE_recipe
 
-$(if $(TRAVIS),,@echo $(TARGET) - $<)
+$(if $(QUIET),,@echo $(TARGET) - $<)
 @$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
 
 endef # ASSEMBLE_recipe
 
 define COMPILE_recipe
 
-$(if $(TRAVIS),,@echo $(TARGET) - $<)
+$(if $(QUIET),,@echo $(TARGET) - $<)
 @$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
 @$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)