]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Put ldscript in common place
authorAntti Kantee <pooka@iki.fi>
Wed, 14 Oct 2015 15:08:15 +0000 (15:08 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 14 Oct 2015 15:12:44 +0000 (15:12 +0000)
platform/Makefile.inc
platform/hw/Makefile
platform/xen/Makefile
tests/nolibc/Makefile

index e7539102ab581b82a1bdef3631cc042360a061b8..f70ef93d27c9e49e2b30a8ca335a10e9a02860d0 100644 (file)
@@ -29,9 +29,12 @@ PSEUDOSTUBS=${COMMONDIR}/rumprun-pseudolinkstubs
 ${PSEUDOSTUBS}.c: ${BASEDIR}/${PLATFORM}/librumprun_base.a
        sh ../makepseudolinkstubs.sh ${NM} ${RUMPSRC} $< $@
 
+bmk.ldscript: ${LDSCRIPT}
+       ln -sf $< $@
+
 commonlibs: platformlibs userlibs
 userlibs: ${BASEDIR}/${PLATFORM}/librumprun_base.a ${PSEUDOSTUBS}.o
-platformlibs: ${COREDIR}/${PLATFORM}/libbmk_core.a ${RUMPUSERDIR}/${PLATFORM}/libbmk_rumpuser.a
+platformlibs: ${COREDIR}/${PLATFORM}/libbmk_core.a ${RUMPUSERDIR}/${PLATFORM}/libbmk_rumpuser.a bmk.ldscript
 compiler_rt: ${COMPILERRTDIR}/${PLATFORM}/libcompiler_rt.a
 
 .PHONY: buildtest
@@ -56,6 +59,7 @@ commonclean:
        ( cd ${COMPILERRTDIR} && \
                ${RUMPMAKE} RUMPSRC=${RUMPSRC} MAKEOBJDIR=${PLATFORM} cleandir )
        rm -f ${PSEUDOSTUBS}.c ${PSEUDOSTUBS}.o
+       rm -f bmk.ldscript
 
 .PHONY: tests
 tests: ${MAINOBJ} commonlibs app-tools
index d51d015a7d967bd7fad2677a6c44b3a27b9addc6..2ed5c7d08e022ae30dab80409f627d07a0f5be4e 100644 (file)
@@ -17,8 +17,6 @@ MAINOBJ=      rumprun-hw-${MACHINE_ARCH}.o
 
 all:  include/hw/machine ${MAINOBJ} ${TARGETS}
 
-include ../Makefile.inc
-
 CPPFLAGS=      -Iinclude -I../../include -nostdinc
 CFLAGS+=       ${BUILDRUMP_TOOL_CFLAGS}
 
@@ -50,15 +48,18 @@ endif
 
 ARCHDIR?= ${MACHINE}
 
+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
 
 APP_TOOLS_PLATFORM= hw
 APP_TOOLS_OBJS_BAKE=   ${MAINOBJ}
-APP_TOOLS_LDSCRIPT_BAKE:= $(abspath arch/${ARCHDIR}/kern.ldscript)
+APP_TOOLS_LDSCRIPT_BAKE:= ${LDSCRIPT}
 APP_TOOLS_DIR:= $(abspath ../../app-tools)
 
 include ${APP_TOOLS_DIR}/Makefile.app-tools
index 6d7b87a76e4ec98941398156883c916f257816c1..ea00e1d086fefa808eb4dc92152610774a148ec6 100644 (file)
@@ -25,6 +25,8 @@ else
 TARGETS+= compiler_rt
 endif
 
+LDSCRIPT:= $(abspath $(OBJ_DIR)/xen/minios.lds)
+
 .PHONY: default
 default: ${TARGETS}
 
@@ -78,7 +80,7 @@ $(MAINOBJ): $(RUMP_OBJS) platformlibs
 
 APP_TOOLS_PLATFORM= xen
 APP_TOOLS_OBJS_BAKE=   $(MAINOBJ)
-APP_TOOLS_LDSCRIPT_BAKE:= $(abspath $(OBJ_DIR)/xen/minios.lds)
+APP_TOOLS_LDSCRIPT_BAKE:= $(LDSCRIPT)
 APP_TOOLS_DIR= $(abspath ../../app-tools)
 
 include $(APP_TOOLS_DIR)/Makefile.app-tools
@@ -87,7 +89,7 @@ include $(APP_TOOLS_DIR)/Makefile.app-tools
 
 clean: app-tools_clean commonclean
        $(MAKE) -C xen OBJ_DIR=$(OBJ_DIR)/xen clean
-       rm -f $(OBJ_DIR)/*.o $(OBJ_DIR)/lib/*.o buildtest
+       rm -f $(OBJ_DIR)/*.o $(OBJ_DIR)/lib/*.o buildtest $(MAINOBJ)
 
 cleanrump: clean
        rm -rf rump rumpobj rumptools
index e51a0ad17d905567042f96513e0e69c48d3e8448..68beeb1c1fd100dbc2d1100faa7229b43408a415 100644 (file)
@@ -17,7 +17,7 @@ LDFLAGS+= -L$(abspath ../../lib/libcompiler_rt/${PLATFORM})
 CPPFLAGS+= -I../../include -I../../rumprun/include -I../../platform/${PLATFORM}/include
 CPPFLAGS+= -nostdlib
 
-LDSCRIPT=$(abspath ../../platform/${PLATFORM}/arch/${MACHINE}/kern.ldscript)
+LDSCRIPT=$(abspath ../../platform/${PLATFORM}/bmk.ldscript)
 
 ifeq (${MACHINE},amd64)
 LDFLAGS+= -z max-page-size=0x1000