From 442306d557e279d94fb9fe79bc2989568daa0184 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 13 May 2013 22:12:46 +0100 Subject: [PATCH] Split off some of the platform-independent stuff (such as as and ncg). --HG-- branch : dtrg-buildsystem rename : plat/pc86/build.mk => mach/i386/build.mk rename : plat/pc86/build.mk => mach/i80/build.mk rename : plat/pc86/build.mk => mach/i86/build.mk rename : plat/pc86/build.mk => mach/m68020/build.mk rename : plat/pc86/build.mk => mach/powerpc/build.mk --- Makefile | 7 +++++++ first/core.mk | 2 -- mach/build.mk | 12 ++++++++++++ mach/i386/build.mk | 8 ++++++++ mach/i80/build.mk | 8 ++++++++ mach/i86/build.mk | 8 ++++++++ mach/m68020/build.mk | 8 ++++++++ mach/powerpc/build.mk | 8 ++++++++ mach/proto/as/build.mk | 6 +++--- mach/proto/ncg/build.mk | 6 +++--- plat/build.mk | 6 ++---- plat/cpm/descr | 6 +++--- plat/linux386/descr | 4 ++-- plat/linux68k/descr | 4 ++-- plat/linuxppc/descr | 6 +++--- plat/pc86/descr | 4 ++-- 16 files changed, 79 insertions(+), 24 deletions(-) create mode 100644 mach/build.mk create mode 100644 mach/i386/build.mk create mode 100644 mach/i80/build.mk create mode 100644 mach/i86/build.mk create mode 100644 mach/m68020/build.mk create mode 100644 mach/powerpc/build.mk diff --git a/Makefile b/Makefile index 596a7cbca..637e8baaf 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,13 @@ include mach/proto/ncg/build.mk include plat/linux/liblinux/build.mk +include mach/build.mk +include mach/i80/build.mk +include mach/i386/build.mk +include mach/i86/build.mk +include mach/m68020/build.mk +# include mach/powerpc/build.mk + include plat/build.mk include plat/pc86/build.mk include plat/cpm/build.mk diff --git a/first/core.mk b/first/core.mk index 09b51a925..143748d98 100644 --- a/first/core.mk +++ b/first/core.mk @@ -31,8 +31,6 @@ endef define ackfile-rule $o: $s $(ACK) \ - $(PLATIND)/descr/$(PLATFORM) \ - $(PLATDEP)/$(PLATFORM)/as \ $(CCOMPILER) \ $(PLATFORM_$(PLATFORM)) \ $(EM_ENCODE) diff --git a/mach/build.mk b/mach/build.mk new file mode 100644 index 000000000..368e6b0ca --- /dev/null +++ b/mach/build.mk @@ -0,0 +1,12 @@ +define build-architecture-impl + $(eval ARCHITECTURE_$(ARCH) := \ + $(PLATDEP)/$(ARCH)/as \ + $(PLATDEP)/$(ARCH)/ncg) + + $(eval PLATFORM := $(ARCH)) + $(call build-as) + $(call build-ncg) +endef + +build-architecture = $(eval $(build-architecture-impl)) + diff --git a/mach/i386/build.mk b/mach/i386/build.mk new file mode 100644 index 000000000..f4670cc2f --- /dev/null +++ b/mach/i386/build.mk @@ -0,0 +1,8 @@ +ARCH := i386 +OPTIMISATION := -O + +D := mach/i386 + +$(eval $(call build-architecture)) + + diff --git a/mach/i80/build.mk b/mach/i80/build.mk new file mode 100644 index 000000000..bd3cfc2b3 --- /dev/null +++ b/mach/i80/build.mk @@ -0,0 +1,8 @@ +ARCH := i80 +OPTIMISATION := -O + +D := mach/i80 + +$(eval $(call build-architecture)) + + diff --git a/mach/i86/build.mk b/mach/i86/build.mk new file mode 100644 index 000000000..2f999023d --- /dev/null +++ b/mach/i86/build.mk @@ -0,0 +1,8 @@ +ARCH := i86 +OPTIMISATION := -O + +D := mach/i86 + +$(eval $(call build-architecture)) + + diff --git a/mach/m68020/build.mk b/mach/m68020/build.mk new file mode 100644 index 000000000..2ddaf85a0 --- /dev/null +++ b/mach/m68020/build.mk @@ -0,0 +1,8 @@ +ARCH := m68020 +OPTIMISATION := -O6 + +D := mach/m68020 + +$(eval $(call build-architecture)) + + diff --git a/mach/powerpc/build.mk b/mach/powerpc/build.mk new file mode 100644 index 000000000..75cbeb5d0 --- /dev/null +++ b/mach/powerpc/build.mk @@ -0,0 +1,8 @@ +ARCH := powerpc +OPTIMISATION := -O + +D := mach/powerpc + +$(eval $(call build-architecture)) + + diff --git a/mach/proto/as/build.mk b/mach/proto/as/build.mk index 9404f13b9..f7b56ca66 100644 --- a/mach/proto/as/build.mk +++ b/mach/proto/as/build.mk @@ -2,7 +2,7 @@ define build-as-impl $(call reset) $(eval cflags += -Imach/$(ARCH)/as -I$(OBJDIR)/$D) - $(eval objdir := $(PLATFORM)) + $(eval objdir := $(ARCH)) $(call cfile, mach/proto/as/comm3.c) $(call dependson, $(OBJDIR)/$D/y.tab.h) @@ -35,8 +35,8 @@ $(OBJDIR)/$D/preprocessed-comm2.y: mach/proto/as/comm2.y $(CPPANSI) mach/proto/as/comm2.y > $$@ $(call file, $(LIBOBJECT)) - $(call cprogram, $(BINDIR)/$(PLATFORM)/as) - $(call installto, $(PLATDEP)/$(PLATFORM)/as) + $(call cprogram, $(BINDIR)/$(ARCH)/as) + $(call installto, $(PLATDEP)/$(ARCH)/as) endef build-as = $(eval $(build-as-impl)) diff --git a/mach/proto/ncg/build.mk b/mach/proto/ncg/build.mk index 100ece434..f3782322b 100644 --- a/mach/proto/ncg/build.mk +++ b/mach/proto/ncg/build.mk @@ -3,7 +3,7 @@ define build-ncg-impl $(call reset) $(eval cflags += -Imach/$(ARCH)/ncg -I$(OBJDIR)/$D -Imach/proto/ncg) -$(eval objdir := $(PLATFORM)) +$(eval objdir := $(ARCH)) $(call cfile, mach/proto/ncg/codegen.c) $(call cfile, mach/proto/ncg/compute.c) @@ -37,8 +37,8 @@ $(call cfile, $(OBJDIR)/$D/tables.c) $(call file, $(LIBEM_DATA)) $(call file, $(LIBFLT_ARITH)) -$(call cprogram, $(BINDIR)/$(PLATFORM)/ncg) -$(call installto, $(PLATDEP)/$(PLATFORM)/ncg) +$(call cprogram, $(BINDIR)/$(ARCH)/ncg) +$(call installto, $(PLATDEP)/$(ARCH)/ncg) endef diff --git a/plat/build.mk b/plat/build.mk index e43b02614..3a80c438d 100644 --- a/plat/build.mk +++ b/plat/build.mk @@ -12,8 +12,9 @@ define build-platform-impl $(call installto, $(PLATIND)/descr/$(PLATFORM)) $(eval PLATFORM_$(PLATFORM) := \ + $(PLATIND)/descr/$(PLATFORM) \ $(PLATFORM_HEADERS_$(PLATFORM)) \ - $(PLATDEP)/$(PLATFORM)/ncg) + $(ARCHITECTURE_$(ARCH))) $(foreach f, $(platform-headers), $(call build-platform-headers, $f)) @@ -22,9 +23,6 @@ define build-platform-impl $(call acklibrary, $(LIBDIR)/$(PLATFORM)/libsys.a) $(call installto, $(PLATIND)/$(PLATFORM)/libsys.a) - $(call build-as) - $(call build-ncg) - $(foreach runtime, $(RUNTIMES), $(build-runtime-$(runtime))) endef diff --git a/plat/cpm/descr b/plat/cpm/descr index b1b579938..436dc40cc 100644 --- a/plat/cpm/descr +++ b/plat/cpm/descr @@ -23,7 +23,7 @@ var C_INCLUDES=-I{EM}/share/ack/{PLATFORM}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{PLATFORM}/ncg + program {EM}/lib/ack/{ARCH}/ncg args < stdout need .e @@ -31,7 +31,7 @@ end name asopt from .s to .so - program {EM}/lib/ack/{PLATFORM}/top + program {EM}/lib/ack/{ARCH}/top args optimizer stdin @@ -40,7 +40,7 @@ end name as from .s.so to .o - program {EM}/lib/ack/{PLATFORM}/as + program {EM}/lib/ack/{ARCH}/as args - -o > < prep cond end diff --git a/plat/linux386/descr b/plat/linux386/descr index ff2b26dfb..a0d23ad3b 100644 --- a/plat/linux386/descr +++ b/plat/linux386/descr @@ -27,7 +27,7 @@ var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{PLATFORM}/ncg + program {EM}/lib/ack/{ARCH}/ncg mapflag -gdb GF=-gdb args {GF?} < stdout @@ -36,7 +36,7 @@ end name as from .s.so to .o - program {EM}/lib/ack/{PLATFORM}/as + program {EM}/lib/ack/{ARCH}/as args - -o > < prep cond end diff --git a/plat/linux68k/descr b/plat/linux68k/descr index 14f973d52..124955b55 100644 --- a/plat/linux68k/descr +++ b/plat/linux68k/descr @@ -27,7 +27,7 @@ var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{PLATFORM}/ncg + program {EM}/lib/ack/{ARCH}/ncg mapflag -gdb GF=-gdb args {GF?} < stdout @@ -36,7 +36,7 @@ end name as from .s.so to .o - program {EM}/lib/ack/{PLATFORM}/as + program {EM}/lib/ack/{ARCH}/as args - -o > < prep cond end diff --git a/plat/linuxppc/descr b/plat/linuxppc/descr index 2cfb9ac48..3311f24c6 100644 --- a/plat/linuxppc/descr +++ b/plat/linuxppc/descr @@ -27,7 +27,7 @@ var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{PLATFORM}/ncg + program {EM}/lib/ack/{ARCH}/ncg mapflag -gdb GF=-gdb args {GF?} < stdout @@ -36,7 +36,7 @@ end name asopt from .s to .so - program {EM}/lib/ack/{PLATFORM}/top + program {EM}/lib/ack/{ARCH}/top args optimizer stdin @@ -45,7 +45,7 @@ end name as from .s.so to .o - program {EM}/lib/ack/{PLATFORM}/as + program {EM}/lib/ack/{ARCH}/as args - -o > < prep cond end diff --git a/plat/pc86/descr b/plat/pc86/descr index a3f11fc4f..f02ab3eed 100644 --- a/plat/pc86/descr +++ b/plat/pc86/descr @@ -23,7 +23,7 @@ var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi name be from .m.g to .s - program {EM}/lib/ack/{PLATFORM}/ncg + program {EM}/lib/ack/{ARCH}/ncg args < stdout need .e @@ -31,7 +31,7 @@ end name as from .s.so to .o - program {EM}/lib/ack/{PLATFORM}/as + program {EM}/lib/ack/{ARCH}/as args - -o > < prep cond end -- 2.34.1