From: Antti Kantee Date: Fri, 16 Oct 2015 16:43:50 +0000 (+0000) Subject: Reduce copypasteware in Makefiles X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=62e7040acd59b896462d3a45e91bd222bb7ca1bd;p=osstest%2Frumprun.git Reduce copypasteware in Makefiles --- diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 779994f..4dce4e0 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -2,6 +2,20 @@ ifeq (${PLATFORM},) $(error need to specify $$PLATFORM!) endif +ifneq (${KERNONLY},true) +TARGETS:= userlibs +else +TARGETS:= compiler_rt +endif + +ifeq (${BUILDRR},true) +CPPFLAGS+= -I${OBJDIR}/dest.stage/include +else +CPPFLAGS+= -I${DESTDIR}/include +endif + +MAINOBJ:= rumprun-${PLATFORM}-${MACHINE_ARCH}.o + COREDIR:= $(shell pwd)/../../lib/libbmk_core RUMPUSERDIR:= $(shell pwd)/../../lib/libbmk_rumpuser COMPILERRTDIR:= $(shell pwd)/../../lib/libcompiler_rt diff --git a/platform/hw/Makefile b/platform/hw/Makefile index 164f424..8b62a0d 100644 --- a/platform/hw/Makefile +++ b/platform/hw/Makefile @@ -1,3 +1,5 @@ +default: all + PLATFORM=hw PLATFORM_DEFAULT_TESTER=qemu @@ -7,25 +9,9 @@ ifdef BUILDRUMP_TOOLFLAGS include ${BUILDRUMP_TOOLFLAGS} endif -ifneq (${KERNONLY},true) -TARGETS:= userlibs -else -TARGETS:= compiler_rt -endif - -MAINOBJ= rumprun-hw-${MACHINE_ARCH}.o - -all: include/hw/machine ${MAINOBJ} ${TARGETS} - CPPFLAGS= -Iinclude -I../../include -nostdinc CFLAGS+= ${BUILDRUMP_TOOL_CFLAGS} -ifeq (${BUILDRR},true) -CPPFLAGS+= -I${OBJDIR}/dest.stage/include -else -CPPFLAGS+= -I${DESTDIR}/include -endif - # Check if we're building for a supported target. supported= false HASPCI= y @@ -52,10 +38,11 @@ LDSCRIPT:= $(abspath arch/${ARCHDIR}/kern.ldscript) OBJS_BMK+= intr.o clock_subr.o kernel.o multiboot.o undefs.o include ../Makefile.inc - include arch/${ARCHDIR}/Makefile.inc -.PHONY: clean cleandir test +.PHONY: clean cleandir test all + +all: include/hw/machine ${MAINOBJ} ${TARGETS} include/hw/machine: @ln -sf ../arch/${MACHINE_ARCH} include/hw/machine diff --git a/platform/xen/Makefile b/platform/xen/Makefile index 90aaace..77e7d95 100644 --- a/platform/xen/Makefile +++ b/platform/xen/Makefile @@ -7,8 +7,6 @@ ifdef BUILDRUMP_TOOLFLAGS include ${BUILDRUMP_TOOLFLAGS} endif -MAINOBJ= rumprun-xen-$(MACHINE_ARCH).o - # # Rumprun-xen Makefile. # Abandon all hope, ye who enter here: @@ -17,30 +15,18 @@ MAINOBJ= rumprun-xen-$(MACHINE_ARCH).o # OBJ_DIR ?= $(CURDIR)/obj -TARGETS= prepare links mini-os $(MAINOBJ) +include ../Makefile.inc -ifneq (${KERNONLY},true) -TARGETS+= userlibs -else -TARGETS+= compiler_rt -endif +TARGETS= prepare links mini-os $(MAINOBJ) LDSCRIPT:= $(abspath $(OBJ_DIR)/xen/minios.lds) .PHONY: default default: ${TARGETS} -include ../Makefile.inc - CPPFLAGS = -isystem xen/include -I. -I../../include CPPFLAGS+= -no-integrated-cpp -nostdinc -ifeq (${BUILDRR},true) -CPPFLAGS+= -isystem ${OBJDIR}/dest.stage/include -else -CPPFLAGS+= -isystem ${DESTDIR}/include -endif - CFLAGS += -fno-builtin ${BUILDRUMP_TOOL_CFLAGS} # This is semi-duplicated from xen/arch/x86/arch.mk, can we avoid that?