]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Reduce copypasteware in Makefiles
authorAntti Kantee <pooka@iki.fi>
Fri, 16 Oct 2015 16:43:50 +0000 (16:43 +0000)
committerAntti Kantee <pooka@iki.fi>
Fri, 16 Oct 2015 18:36:18 +0000 (18:36 +0000)
platform/Makefile.inc
platform/hw/Makefile
platform/xen/Makefile

index 779994f331675ca23c76f5d3bf7f5e81292592b2..4dce4e01eb64fa7d3a8aac0d3745291f212f3f53 100644 (file)
@@ -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
index 164f42436817161af610ec2d8ab216c66f923ccb..8b62a0d8b42be84cbeb30fe2c2c438984e09d545 100644 (file)
@@ -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
index 90aaacef50992fd36185af81a308853dd0fc20db..77e7d955ede3b19b5a8b683d9f8b16dbda4cfbbb 100644 (file)
@@ -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?