]> git.sur5r.net Git - cc65/commitdiff
Have src/Makefile and libsrc/Make use disjoint work directories.
authorOliver Schmidt <ol.sc@web.de>
Wed, 5 Mar 2014 22:24:35 +0000 (23:24 +0100)
committerOliver Schmidt <ol.sc@web.de>
Wed, 5 Mar 2014 22:24:35 +0000 (23:24 +0100)
Building the clean target in src or libsrc should only delete stuff created by the make in those directories. Having both separated allows the Travis CI build to replace the native binaries with cross built binaries while keeping everything else.

.travis.yml
libsrc/Makefile
libsrc/apple2/targetutil/Makefile.inc
libsrc/atari/targetutil/Makefile.inc
libsrc/geos-apple/targetutil/Makefile.inc
libsrc/nes/Makefile.inc

index 457503ea077e52b7594b4be5dc30460b04127c9a..3a0ee09a17fa7a0fc9c293342bf60a9d98986aec 100644 (file)
@@ -4,7 +4,7 @@ install:
   - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686
 script:
   - make all doc
-  - make clean bin CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar PROGEXT=.exe
+  - make -C src clean all CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar PROGEXT=.exe
 after_success:
   - make -C doc gh-pages
 env:
index 19fb5ac3f7c30b2960de26531db6a43525a5c8d7..0a8c844b65a7e096f2b91c4def4f186d6be17758 100644 (file)
@@ -68,10 +68,10 @@ $(TARGETS):
        @$(MAKE) --no-print-directory $@
 
 mostlyclean:
-       $(call RMDIR,../wrk)
+       $(call RMDIR,../libwrk)
 
 clean:
-       $(call RMDIR,../wrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
+       $(call RMDIR,../libwrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
 
 install:
        $(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
@@ -162,7 +162,7 @@ vpath %.c $(SRCDIRS)
 OBJS := $(patsubst %.s,%.o,$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.s)))
 OBJS += $(patsubst %.c,%.o,$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c)))
 
-OBJS := $(addprefix ../wrk/$(TARGET)/,$(sort $(notdir $(OBJS))))
+OBJS := $(addprefix ../libwrk/$(TARGET)/,$(sort $(notdir $(OBJS))))
 
 DEPS = $(OBJS:.o=.d)
 
@@ -170,9 +170,9 @@ EXTRA_SRCPAT = $(SRCDIR)/extra/%.s
 EXTRA_OBJPAT = ../lib/$(TARGET)-%.o
 EXTRA_OBJS := $(patsubst $(EXTRA_SRCPAT),$(EXTRA_OBJPAT),$(wildcard $(SRCDIR)/extra/*.s))
 
-ZPOBJ = ../wrk/$(TARGET)/zeropage.o
+ZPOBJ = ../libwrk/$(TARGET)/zeropage.o
 ifeq ($(TARGET),$(filter $(TARGET),$(EXTZP)))
-  ZPOBJ += ../wrk/$(TARGET)/extzp.o
+  ZPOBJ += ../libwrk/$(TARGET)/extzp.o
 endif
 
 ifeq ($(TARGET),$(filter $(TARGET),$(MKINC)))
@@ -188,12 +188,12 @@ endif
 define DRVTYPE_template
 
 $1_SRCDIR = $$(SRCDIR)/$1
-$1_OBJDIR = ../wrk/$$(TARGET)/$1
+$1_OBJDIR = ../libwrk/$$(TARGET)/$1
 $1_DRVDIR = ../$1
 
 $1_OBJPAT = $$($1_OBJDIR)/$$(OBJPFX)%.o
 $1_DRVPAT = $$($1_DRVDIR)/$$(DRVPFX)%.$1
-$1_STCPAT = ../wrk/$$(TARGET)/$$(DRVPFX)%-$1.o
+$1_STCPAT = ../libwrk/$$(TARGET)/$$(DRVPFX)%-$1.o
 
 $1_OBJS := $$(patsubst $$($1_SRCDIR)/%.s,$$($1_OBJDIR)/%.o,$$(wildcard $$($1_SRCDIR)/*.s))
 
@@ -256,10 +256,10 @@ endef
 
 ##########
 
-../wrk/$(TARGET)/%.o: %.s | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/%.o: %.s | ../libwrk/$(TARGET)
        $(ASSEMBLE_recipe)
 
-../wrk/$(TARGET)/%.o: %.c | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/%.o: %.c | ../libwrk/$(TARGET)
        $(COMPILE_recipe)
 
 $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
@@ -269,7 +269,7 @@ $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
 ../lib/$(TARGET).lib: $(OBJS) | ../lib
        $(AR65) a $@ $?
 
-../wrk/$(TARGET) ../lib ../targetutil:
+../libwrk/$(TARGET) ../lib ../targetutil:
        @$(call MKDIR,$@)
 
 $(TARGET): $(EXTRA_OBJS) ../lib/$(TARGET).lib
index 7904607b3a1c4253ab904b0231506df34f0cafeb..105a5324fb356b054f7eca182408593009dd9487 100644 (file)
@@ -1,9 +1,9 @@
-DEPS += ../wrk/$(TARGET)/loader.d
+DEPS += ../libwrk/$(TARGET)/loader.d
 
-../wrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/loader.o: $(SRCDIR)/targetutil/loader.s | ../libwrk/$(TARGET)
        $(ASSEMBLE_recipe)
 
-../targetutil/loader.system: ../wrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
+../targetutil/loader.system: ../libwrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
        $(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^)
 
 $(TARGET): ../targetutil/loader.system
index 01b5e7507718762b6a4769c63159f2025fa1bd45..05405f2e6b46e442b8197c55dc786bf412cf6712 100644 (file)
@@ -1,9 +1,9 @@
-DEPS += ../wrk/$(TARGET)/w2cas.d
+DEPS += ../libwrk/$(TARGET)/w2cas.d
 
-../wrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/w2cas.o: $(SRCDIR)/targetutil/w2cas.c | ../libwrk/$(TARGET)
        $(COMPILE_recipe)
 
-../targetutil/w2cas.com: ../wrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../targetutil
+../targetutil/w2cas.com: ../libwrk/$(TARGET)/w2cas.o ../lib/$(TARGET).lib | ../targetutil
        $(LD65) -o $@ -t $(TARGET) $^
 
 $(TARGET): ../targetutil/w2cas.com
index 01ae3f55ce5e7c2cd7eed290e79915c28b68039d..fbe31981c1978e173d12e0b97b7ca647cf934f13 100644 (file)
@@ -1,14 +1,14 @@
-DEPS += ../wrk/$(TARGET)/convert.d
+DEPS += ../libwrk/$(TARGET)/convert.d
 
-../wrk/$(TARGET)/convert.o: TARGET = apple2enh
+../libwrk/$(TARGET)/convert.o: TARGET = apple2enh
 
-../wrk/$(TARGET)/convert.o: $(SRCDIR)/targetutil/convert.c | ../wrk/$(TARGET)
+../libwrk/$(TARGET)/convert.o: $(SRCDIR)/targetutil/convert.c | ../libwrk/$(TARGET)
        $(COMPILE_recipe)
 
 ../lib/apple2enh.lib:
        @$(MAKE) --no-print-directory apple2enh
 
-../targetutil/convert.system: ../wrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
+../targetutil/convert.system: ../libwrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
        $(LD65) -o $@ -C apple2enh-system.cfg $^
 
 $(TARGET): ../targetutil/convert.system
index 1be43497f002a2fe0ccebc095b9e8b3c2a890dfa..f1dcbf18e697bf4fd3dd1aa7fc0c105663b92ebf 100644 (file)
@@ -1,8 +1,8 @@
-../tgi/nes-64-56-2.tgi: ../wrk/nes/clrscr.o \
-                        ../wrk/nes/cputc.o  \
-                        ../wrk/nes/get_tv.o \
-                        ../wrk/nes/gotoxy.o \
-                        ../wrk/nes/popa.o   \
-                        ../wrk/nes/ppu.o    \
-                        ../wrk/nes/ppubuf.o \
-                        ../wrk/nes/setcursor.o
+../tgi/nes-64-56-2.tgi: ../libwrk/nes/clrscr.o \
+                        ../libwrk/nes/cputc.o  \
+                        ../libwrk/nes/get_tv.o \
+                        ../libwrk/nes/gotoxy.o \
+                        ../libwrk/nes/popa.o   \
+                        ../libwrk/nes/ppu.o    \
+                        ../libwrk/nes/ppubuf.o \
+                        ../libwrk/nes/setcursor.o