From fd81cd2ae07752b5565eddff4ab42c5937ea3efd Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 10 Jan 2001 16:13:41 +0000 Subject: [PATCH] Support VPATH builds. committer: mfx 979143221 +0000 --- src/Makefile | 2 +- src/stub/Makefile | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4c93d005..43a611d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -86,7 +86,7 @@ OBJECTS = $(OBJECTS1) $(OBJECTS2) $(OBJECTS3) CC = gcc CXX = $(CC) DEFS = -INCLUDES = -I$(srcdir) +INCLUDES = -I. -I$(srcdir) CFLAGS_OUTPUT = -o $@ CXXFLAGS_OUTPUT = $(CFLAGS_OUTPUT) diff --git a/src/stub/Makefile b/src/stub/Makefile index b3af5081..573848cd 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -37,7 +37,9 @@ STUBS = \ l_vmlinz.h # experimental: -##STUBS += l_t_x2b.h l_t_x2bs.h l_t_x2d.h l_t_x2ds.h +ifneq ($(strip $(wildcard l_tos2.s)),) +STUBS += l_t_x2b.h l_t_x2bs.h l_t_x2d.h l_t_x2ds.h +endif # util var for use in the rules - basename of the current target @@ -66,6 +68,7 @@ vpath %.ash $(UCL_M68K) NASM = /usr/topics/asm/nasm-20000903/nasm -O0 -w+macro-params -w+orphan-labels NASM = /usr/topics/asm/nasm-20000903/nasm -O2 -w+macro-params -w+orphan-labels NASM = nasm -w+macro-params -w+orphan-labels +NASM += -i$(srcdir)/ APP = perl -w $(srcdir)/scripts/app.pl BIN2H = perl -w $(srcdir)/scripts/bin2h.pl @@ -248,21 +251,21 @@ l_t_x2ds.h: l_tos2.s l_lx_n2b.h: l_lx_exec.c l_xe_n2b.o l_lx_exec86.lds Makefile $(CC_LINUX) -DNRV2B -o $T.o -c $< - ld -T l_lx_exec86.lds -Map $T.map -o $T.bin l_xe_n2b.o $T.o + ld -T $(srcdir)/l_lx_exec86.lds -Map $T.map -o $T.bin l_xe_n2b.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386exec_nrv2b_loader $@ l_le_n2b.h: l_lx_elf.c l_6e_n2b.o l_lx_elf86.lds $(CC_LINUX) -DNRV2B -o $T.o -c $< - ld -T l_lx_elf86.lds -Map $T.map -o $T.bin l_6e_n2b.o $T.o + ld -T $(srcdir)/l_lx_elf86.lds -Map $T.map -o $T.bin l_6e_n2b.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386elf_nrv2b_loader $@ l_sh_n2b.h: l_lx_sh.c l_6h_n2b.o l_lx_sh86.lds $(CC_LINUX) -DNRV2B -o $T.o -c $< - ld -T l_lx_sh86.lds -Map $T.map -o $T.bin l_6h_n2b.o $T.o + ld -T $(srcdir)/l_lx_sh86.lds -Map $T.map -o $T.bin l_6h_n2b.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386sh_nrv2b_loader $@ @@ -279,21 +282,21 @@ l_6h_n2b.o: l_lx_sh86.asm l_lx_n2d.h: l_lx_exec.c l_xe_n2d.o l_lx_exec86.lds $(CC_LINUX) -DNRV2D -o $T.o -c $< - ld -T l_lx_exec86.lds -Map $T.map -o $T.bin l_xe_n2d.o $T.o + ld -T $(srcdir)/l_lx_exec86.lds -Map $T.map -o $T.bin l_xe_n2d.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386exec_nrv2d_loader $@ l_le_n2d.h: l_lx_elf.c l_6e_n2d.o l_lx_elf86.lds $(CC_LINUX) -DNRV2D -o $T.o -c $< - ld -T l_lx_elf86.lds -Map $T.map -o $T.bin l_6e_n2d.o $T.o + ld -T $(srcdir)/l_lx_elf86.lds -Map $T.map -o $T.bin l_6e_n2d.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386elf_nrv2d_loader $@ l_sh_n2d.h: l_lx_sh.c l_6h_n2d.o l_lx_sh86.lds $(CC_LINUX) -DNRV2D -o $T.o -c $< - ld -T l_lx_sh86.lds -Map $T.map -o $T.bin l_6h_n2d.o $T.o + ld -T $(srcdir)/l_lx_sh86.lds -Map $T.map -o $T.bin l_6h_n2d.o $T.o $(SETFOLD) $T.bin $(BRANDELF) $T.bin $(BIN2H) $T.bin linux_i386sh_nrv2d_loader $@ @@ -312,14 +315,14 @@ l_lx_sep.o: l_lx_sep.c upxb: l_lx_sep.o l_lx_sep86.asm $(NASM) -i$(UCL_I386)/ -f elf -dNRV2B -o $T.o l_lx_sep86.asm - ld -T l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o + ld -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o objcopy -S -R .comment -R .note $@ $(STRIPELF) $@ $(BRANDELF) $@ upxd: l_lx_sep.o l_lx_sep86.asm $(NASM) -i$(UCL_I386)/ -f elf -dNRV2D -o $T.o l_lx_sep86.asm - ld -T l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o + ld -T $(srcdir)/l_lx_sep86.lds -Map $T.map -o $@ $T.o l_lx_sep.o objcopy -S -R .comment -R .note $@ $(STRIPELF) $@ $(BRANDELF) $@