1.1 --- a/mk/common.mk Mon Oct 22 19:12:33 2018 +0200
1.2 +++ b/mk/common.mk Mon Oct 22 21:44:02 2018 +0200
1.3 @@ -23,6 +23,11 @@
1.4 OBJCOPY=$(ARCH)-objcopy
1.5 OBJDUMP=$(ARCH)-objdump
1.6
1.7 +# These paths are relative to each example directory.
1.8 +
1.9 +INCDIR = ../../include
1.10 +LIBDIR = ../../lib
1.11 +
1.12 # NOTE: -O2 is actually needed to prevent memcpy references, whereas probably
1.13 # NOTE: one of the -f{freestanding, no-hosted, no-builtin} options should work.
1.14 # NOTE: See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
1.15 @@ -31,21 +36,21 @@
1.16 -fno-unit-at-a-time -fno-zero-initialized-in-bss \
1.17 -ffreestanding -fno-hosted -fno-builtin \
1.18 -march=mips32 \
1.19 - -I. -I../..
1.20 + -I. \
1.21 + -I$(INCDIR)
1.22 LDFLAGS = -nostdlib -EL
1.23
1.24 # Ordering of objects is important and cannot be left to replacement rules.
1.25 -# These are relative to each example directory.
1.26
1.27 -START_SRC = ../../start.S
1.28 -START_OBJ = ../../start.o
1.29 +START_SRC = $(LIBDIR)/start.S
1.30 +START_OBJ = $(LIBDIR)/start.o
1.31
1.32 # Application-specific files appear after the above but before those below in
1.33 # the application Makefiles.
1.34
1.35 -COMMON_SRC = ../../init.c ../../debug.c ../../cpu.S
1.36 -COMMON_OBJ = ../../init.o ../../debug.o ../../cpu.o
1.37 +COMMON_SRC = $(LIBDIR)/init.c $(LIBDIR)/debug.c $(LIBDIR)/cpu.S
1.38 +COMMON_OBJ = $(LIBDIR)/init.o $(LIBDIR)/debug.o $(LIBDIR)/cpu.o
1.39
1.40 # Common linker script.
1.41
1.42 -SCRIPT = ../../payload.ld
1.43 +SCRIPT = $(LIBDIR)/payload.ld