From 3f0af9b241e22d3d08772be66a01802b2ef65e65 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Wed, 5 Mar 2014 23:24:35 +0100
Subject: [PATCH] Have src/Makefile and libsrc/Make use disjoint work
directories.
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 | 2 +-
libsrc/Makefile | 20 ++++++++++----------
libsrc/apple2/targetutil/Makefile.inc | 6 +++---
libsrc/atari/targetutil/Makefile.inc | 6 +++---
libsrc/geos-apple/targetutil/Makefile.inc | 8 ++++----
libsrc/nes/Makefile.inc | 16 ++++++++--------
6 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 457503ea0..3a0ee09a1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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:
diff --git a/libsrc/Makefile b/libsrc/Makefile
index 19fb5ac3f..0a8c844b6 100644
--- a/libsrc/Makefile
+++ b/libsrc/Makefile
@@ -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
diff --git a/libsrc/apple2/targetutil/Makefile.inc b/libsrc/apple2/targetutil/Makefile.inc
index 7904607b3..105a5324f 100644
--- a/libsrc/apple2/targetutil/Makefile.inc
+++ b/libsrc/apple2/targetutil/Makefile.inc
@@ -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
diff --git a/libsrc/atari/targetutil/Makefile.inc b/libsrc/atari/targetutil/Makefile.inc
index 01b5e7507..05405f2e6 100644
--- a/libsrc/atari/targetutil/Makefile.inc
+++ b/libsrc/atari/targetutil/Makefile.inc
@@ -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
diff --git a/libsrc/geos-apple/targetutil/Makefile.inc b/libsrc/geos-apple/targetutil/Makefile.inc
index 01ae3f55c..fbe31981c 100644
--- a/libsrc/geos-apple/targetutil/Makefile.inc
+++ b/libsrc/geos-apple/targetutil/Makefile.inc
@@ -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
diff --git a/libsrc/nes/Makefile.inc b/libsrc/nes/Makefile.inc
index 1be43497f..f1dcbf18e 100644
--- a/libsrc/nes/Makefile.inc
+++ b/libsrc/nes/Makefile.inc
@@ -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
--
2.39.5