mirror of
https://github.com/cc65/cc65.git
synced 2025-01-23 13:30:01 +00:00
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.
This commit is contained in:
parent
9e409a67d2
commit
3f0af9b241
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user