-.PHONY: all mostlyclean clean install avail unavail bin lib doc
+.PHONY: all mostlyclean clean install zip avail unavail bin lib doc
.SUFFIXES:
-all mostlyclean clean install:
+all mostlyclean clean install zip:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
CMD_EXE = 1
endif
-.PHONY: all mostlyclean clean install doc html info gh-pages
+.PHONY: all mostlyclean clean install zip doc html info gh-pages
.SUFFIXES:
ifdef CMD_EXE
-clean doc:
+clean zip doc:
else # CMD_EXE
clean:
$(RM) -r ../html ../info
+zip:
+ cd .. && zip cc65 html/*.*
+
doc: html info
html: $(addprefix ../html/,$(SGMLS:.sgml=.html) doc.css doc.png)
ser \
tgi
-.PHONY: all mostlyclean clean install lib $(TARGETS)
+OUTPUTDIRS = lib \
+ $(DRVTYPES) \
+ targetutil \
+ asminc \
+ cfg \
+ include \
+ $(subst ../,,$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)))
+
+.PHONY: all mostlyclean clean install zip lib $(TARGETS)
.SUFFIXES:
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 $@
sim65 \
sp65
-.PHONY: all mostlyclean clean install avail unavail bin $(PROGS)
+.PHONY: all mostlyclean clean install zip avail unavail bin $(PROGS)
.SUFFIXES:
endif # CMD_EXE
+zip:
+ cd .. && zip cc65 bin/*
+
define OBJS_template
$1_OBJS := $$(patsubst %.c,../wrk/%.o,$$(wildcard $1/*.c))