diff -ur cc65-2.13.2-orig//make/gcc.mak cc65-2.13.2-new//make/gcc.mak --- cc65-2.13.2-orig//make/gcc.mak 2010-04-06 21:05:59.659188896 +0200 +++ cc65-2.13.2-new//make/gcc.mak 2010-04-06 21:26:31.323885004 +0200 @@ -15,7 +15,8 @@ # (That trick has been disabled.) # The install prefix and directories -prefix = /usr/local +D=$(DEST_DIR) +prefix = /usr exec_prefix = $(prefix) bindir = $(exec_prefix)/bin @@ -34,7 +35,7 @@ # Programs -MKDIR = mkdir -m 755 +MKDIR = mkdir -m 755 -p # BSD-like install-script/-program INSTALL = make/install-sh @@ -119,76 +120,76 @@ fi 2>/dev/null .PHONY: install-dirs -install-dirs: $(bindir) $(datadir) $(docdir) $(libdir) \ - $(CC65_DOC) $(CC65_HOME) \ - $(CA65_INC) $(CC65_INC) \ - $(CC65_INC)/em $(CC65_INC)/geos $(CC65_INC)/joystick \ - $(CC65_INC)/mouse $(CC65_INC)/sys $(CC65_INC)/tgi \ - $(LD65_CFG) $(LD65_LIB) $(LD65_OBJ) \ - $(CC65_HOME)/emd $(CC65_HOME)/joy $(CC65_HOME)/mou \ - $(CC65_HOME)/ser $(CC65_HOME)/tgi - -$(bindir) $(datadir) $(docdir) $(libdir) \ -$(CC65_DOC) $(CC65_HOME) \ -$(CA65_INC) $(CC65_INC) \ -$(LD65_CFG) $(LD65_LIB) $(LD65_OBJ): +install-dirs: $(D)/$(bindir) $(D)/$(datadir) $(D)/$(docdir) $(D)/$(libdir) \ + $(D)/$(CC65_DOC) $(D)/$(CC65_HOME) \ + $(D)/$(CA65_INC) $(D)/$(CC65_INC) \ + $(D)/$(CC65_INC)/em $(D)/$(CC65_INC)/geos $(D)/$(CC65_INC)/joystick \ + $(D)/$(CC65_INC)/mouse $(D)/$(CC65_INC)/sys $(D)/$(CC65_INC)/tgi \ + $(D)/$(LD65_CFG) $(D)/$(LD65_LIB) $(D)/$(LD65_OBJ) \ + $(D)/$(CC65_HOME)/emd $(D)/$(CC65_HOME)/joy $(D)/$(CC65_HOME)/mou \ + $(D)/$(CC65_HOME)/ser $(D)/$(CC65_HOME)/tgi + +$(D)/$(bindir) $(D)/$(datadir) $(D)/$(docdir) $(D)/$(libdir) \ +$(D)/$(CC65_DOC) $(D)/$(CC65_HOME) \ +$(D)/$(CA65_INC) $(D)/$(CC65_INC) \ +$(D)/$(LD65_CFG) $(D)/$(LD65_LIB) $(D)/$(LD65_OBJ): $(MKDIR) $@ -$(CC65_HOME)/% $(CC65_INC)/% $(CC65_DOC)/%: +$(D)/$(CC65_HOME)/% $(D)/$(CC65_INC)/% $(D)/$(CC65_DOC)/%: $(MKDIR) $@ install-bins: for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc; \ - do $(INSTALL_STRIP) src/$$f/$$f${EXT} $(bindir) || exit $$?; \ + do $(INSTALL_STRIP) src/$$f/$$f${EXT} $(D)/$(bindir) || exit $$?; \ done - $(INSTALL_PROG) src/ca65html/ca65html $(bindir) + $(INSTALL_PROG) src/ca65html/ca65html $(D)/$(bindir) install-libs: for f in asminc/*.inc; \ - do $(INSTALL_DATA) $$f $(CA65_INC) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CA65_INC) || exit $$?; \ done for f in include/*.h; \ - do $(INSTALL_DATA) $$f $(CC65_INC) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CC65_INC) || exit $$?; \ done for d in em geos joystick mouse sys tgi; \ do for f in include/$$d/*.h; \ - do $(INSTALL_DATA) $$f $(CC65_INC)/$$d || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CC65_INC)/$$d || exit $$?; \ done || exit $$?; \ done for f in libsrc/*.lib; \ - do $(INSTALL_DATA) $$f $(LD65_LIB) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(LD65_LIB) || exit $$?; \ done for f in libsrc/*-*.o; \ - do $(INSTALL_DATA) $$f $(LD65_OBJ) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(LD65_OBJ) || exit $$?; \ done for d in emd joy mou ser tgi; \ do for f in libsrc/*.$$d; \ - do $(INSTALL_DATA) $$f $(CC65_HOME)/$$d || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CC65_HOME)/$$d || exit $$?; \ done || exit $$?; \ done for f in src/ld65/cfg/*-*.cfg; \ - do $(INSTALL_DATA) $$f $(LD65_CFG) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(LD65_CFG) || exit $$?; \ done install-docs: for f in src/ca65/macpack/*.mac; \ - do $(INSTALL_DATA) $$f $(CC65_DOC) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CC65_DOC) || exit $$?; \ done for f in readme.1st compile.txt CREDITS BUGS internal.txt newvers.txt; \ - do $(INSTALL_DATA) doc/$$f $(CC65_DOC) || exit $$?; \ + do $(INSTALL_DATA) doc/$$f $(D)/$(CC65_DOC) || exit $$?; \ done if [ -f doc/index.htm* ]; \ then for f in doc/*.htm*; \ - do $(INSTALL_DATA) $$f $(CC65_DOC) || exit $$?; \ + do $(INSTALL_DATA) $$f $(D)/$(CC65_DOC) || exit $$?; \ done; \ fi -install-samps: ${addprefix $(CC65_DOC)/, $(shell find samples -type d)} +install-samps: ${addprefix $(D)/$(CC65_DOC)/, $(shell find samples -type d)} @$(MAKE) -C samples zap for d in `find samples -type d`; \ do for f in $$d/*; \ do if [ -f $$f ]; \ - then $(INSTALL_DATA) $$f $(CC65_DOC)/$$d || exit $$?; \ + then $(INSTALL_DATA) $$f $(D)/$(CC65_DOC)/$$d || exit $$?; \ fi; \ done || exit $$?; \ done