aboutsummaryrefslogtreecommitdiffstats
path: root/diag
diff options
context:
space:
mode:
Diffstat (limited to 'diag')
-rw-r--r--diag/Makefile5
-rw-r--r--diag/geodsp/Makefile11
-rw-r--r--diag/mbr/Makefile5
3 files changed, 11 insertions, 10 deletions
diff --git a/diag/Makefile b/diag/Makefile
index 969acbb3..e3353753 100644
--- a/diag/Makefile
+++ b/diag/Makefile
@@ -1,4 +1,7 @@
SUBDIRS = mbr geodsp
all tidy dist clean spotless install:
- set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
+ @mkdir -p $(addprefix $(OBJ)/,$(SUBDIRS))
+ set -e; for d in $(SUBDIRS); \
+ do $(MAKE) -C $(OBJ)/$$d -f $(SRC)/$$d/Makefile \
+ SRC="$(SRC)"/$$d OBJ="$(OBJ)"/$$d $@; done
diff --git a/diag/geodsp/Makefile b/diag/geodsp/Makefile
index 67637f91..2fd05c96 100644
--- a/diag/geodsp/Makefile
+++ b/diag/geodsp/Makefile
@@ -18,15 +18,14 @@
# Makefile for the SYSLINUX geometry display for diagnostics
#
-topdir = ../..
-MAKEDIR = $(topdir)/mk
include $(MAKEDIR)/embedded.mk
coredir = $(topdir)/core
+VPATH = $(SRC)
BTARGET = geodsp1s.bin geodspms.bin \
geodsp1s.img.xz geodspms.img.xz
-NASMOPT = -i $(coredir)/ -Ox -f bin -dBINFMT
+NASMOPT = -i $(coredir)/ -i $(SRC)/ -Ox -f bin -dBINFMT
NASMOPT += -w+orphan-labels
CFLAGS = -g -O
@@ -34,14 +33,14 @@ all: $(BTARGET)
# Higher compression levels result in larger files
%.img.xz: %.bin mk-lba-img.pl
- $(PERL) mk-lba-img.pl $< | $(XZ) -0 > $@ || ( rm -f $@ ; false )
+ $(PERL) $(SRC)/mk-lba-img $< | $(XZ) -0 > $@ || ( rm -f $@ ; false )
%.img.gz: %.bin mk-lba-img.pl
- $(PERL) mk-lba-img.pl $< | $(GZIPPROG) -9 > $@ || ( rm -f $@ ; false )
+ $(PERL) $(SRC)/mk-lba-img $< | $(GZIPPROG) -9 > $@ || ( rm -f $@ ; false )
# in case someone really wants these without needing a decompressor
%.img: %.bin mk-lba-img.pl
- $(PERL) mk-lba-img.pl $< > $@ || ( rm -f $@ ; false )
+ $(PERL) mk-lba-img $< > $@ || ( rm -f $@ ; false )
%.bin: %.asm $(coredir)/writehex.inc $(coredir)/macros.inc $(coredir)/diskboot.inc
$(NASM) $(NASMOPT) -o $@ -l $(@:.bin=.lst) $<
diff --git a/diag/mbr/Makefile b/diag/mbr/Makefile
index 79ff9f01..5b7153c9 100644
--- a/diag/mbr/Makefile
+++ b/diag/mbr/Makefile
@@ -15,10 +15,9 @@
# Makefile for MBR
#
-topdir = ../..
mbrdir = $(topdir)/mbr
-MAKEDIR = $(topdir)/mk
include $(MAKEDIR)/embedded.mk
+VPATH = $(SRC)
all: handoff.bin
@@ -27,7 +26,7 @@ all: handoff.bin
.PRECIOUS: %.elf
%.elf: %.o $(mbrdir)/mbr.ld
- $(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T $(mbrdir)/$(ARCH)/mbr.ld -e _start -o $@ $<
%.bin: %.elf $(mbrdir)/checksize.pl
$(OBJCOPY) -O binary $< $@