]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Build libs into objdir.
authorAntti Kantee <pooka@iki.fi>
Thu, 22 Oct 2015 14:48:59 +0000 (14:48 +0000)
committerAntti Kantee <pooka@iki.fi>
Thu, 22 Oct 2015 14:48:59 +0000 (14:48 +0000)
The grand implication of this commit is that now it's possible to
build both hw and xen from the same source tree (which is useful
mostly for me so that I can easily test things when developing).
nb. different target cpus are still not supported from the same
source tree.

build-rr.sh
platform/Makefile.inc
platform/xen/Makefile

index ea09b9d06e173cd426ce4e3b202be3ca44f88ca8..8a34520f166cf3d3e9ee1c08e9298376099e8d67 100755 (executable)
@@ -212,11 +212,10 @@ checkprevbuilds ()
                . ./.prevbuild
                : ${PB_KERNONLY:=false} # "bootstrap", remove in a few months
                if [ "${PB_MACHINE}" != "${MACHINE}" \
-                   -o "${PB_PLATFORM}" != "${PLATFORM}" \
                    -o "${PB_KERNONLY}" != "${KERNONLY}" \
                ]; then
                        echo '>> ERROR:'
-                       echo '>> Building for multiple machine/platform combos'
+                       echo '>> Building for multiple machine combos'
                        echo '>> from the same rumprun source tree is currently'
                        echo '>> not supported.  See rumprun issue #35.'
                        printf '>> %20s: %s/%s nolibc=%s\n' 'Previously built' \
@@ -227,7 +226,6 @@ checkprevbuilds ()
                fi
        else
                echo PB_MACHINE=${MACHINE} > ./.prevbuild
-               echo PB_PLATFORM=${PLATFORM} >> ./.prevbuild
                echo PB_KERNONLY=${KERNONLY} >> ./.prevbuild
        fi
 }
@@ -329,18 +327,6 @@ builduserspace ()
        for lib in ${LIBS}; do
                makeuserlib ${lib}
        done
-       makeuserlib $(pwd)/lib/librumprun_base ${PLATFORM}
-       makeuserlib $(pwd)/lib/librumprun_tester ${PLATFORM}
-
-       # build unwind bits if we support c++
-       if ${HAVECXX}; then
-               ( cd lib/libunwind
-                   ${RUMPMAKE} ${STDJ} obj
-                   ${RUMPMAKE} ${STDJ} includes
-                   ${RUMPMAKE} ${STDJ} dependall
-                   ${RUMPMAKE} ${STDJ} install
-               )
-       fi
 }
 
 buildpci ()
@@ -353,16 +339,6 @@ buildpci ()
        fi
 }
 
-buildkernlibs ()
-{
-
-       ( cd lib/librumpkern_bmktc
-               ${RUMPMAKE} ${STDJ} obj
-               ${RUMPMAKE} ${STDJ} dependall
-               ${RUMPMAKE} ${STDJ} install
-       )
-}
-
 wraponetool ()
 {
 
@@ -428,8 +404,6 @@ dobuild ()
 
        buildpci
 
-       buildkernlibs
-
        # run routine specified in platform.conf
        doextras || die 'platforms extras failed.  tillerman needs tea?'
 
index d0f7c132c35028332aa5b63c1c3d4f0645587d04..3101d810db79ce4bcf841569365a5f2a0d988871 100644 (file)
@@ -2,12 +2,17 @@ ifeq (${PLATFORM},)
 $(error need to specify $$PLATFORM!)
 endif
 
+TARGETS=       rumpkernlibs
+# compiler_rt is strictly speaking necessary only in KERNONLY=true,
+# but building it always makes testing kernonly easier
+TARGETS+=      compiler_rt
+INSTALLTGTS=   librumpkern_bmktc_install
+
 ifneq (${KERNONLY},true)
-TARGETS= userlibs
+TARGETS+=      userlibs
+INSTALLTGTS+=  librumprun_base_install librumprun_tester_install
+INSTALLTGTS+=  libunwind_install
 endif
-# XXX: compiler_rt needs to be built only for KERNONLY=true,
-# building it always makes testing easier
-TARGETS+= compiler_rt
 
 ifeq (${BUILDRR},true)
 CPPFLAGS+=      -I${RROBJ}/dest.stage/include
@@ -29,6 +34,12 @@ $${RROBJLIB}/${1}/${1}.a:
            && ${RUMPMAKE} MAKEOBJDIR=${RROBJLIB}/${1} ${2} obj \
            && ${RUMPMAKE} MAKEOBJDIR=${RROBJLIB}/${1} ${2} dependall )
 
+.PHONY: ${1}_install
+${1}_install:
+       ( cd $${RROBJLIB}/${1} && \
+           install -m 0444 ${1}.a $${INSTALLDIR}/lib )
+
+.PHONY: ${1}_clean
 ${1}_clean:
        ( cd $${LIBDIR}/${1} && \
            ${RUMPMAKE} MAKEOBJDIR=${RROBJLIB}/${1} ${2} cleandir )
@@ -36,19 +47,24 @@ endef
 
 $(eval $(call BUILDLIB_target,libbmk_core))
 $(eval $(call BUILDLIB_target,libbmk_rumpuser))
+$(eval $(call BUILDLIB_target,librumpkern_bmktc))
+$(eval $(call BUILDLIB_target,librumprun_base))
+$(eval $(call BUILDLIB_target,librumprun_tester))
+$(eval $(call BUILDLIB_target,libunwind))
 $(eval $(call BUILDLIB_target,libcompiler_rt,RUMPSRC=${RUMPSRC}))
 
 PSEUDOSTUBS=${RROBJ}/rumprun-pseudolinkstubs
 
-${PSEUDOSTUBS}.c: ${RROBJ}/dest.stage/lib/librumprun_base.a
+${PSEUDOSTUBS}.c: ${RROBJLIB}/librumprun_base/librumprun_base.a
        sh ../makepseudolinkstubs.sh ${NM} ${RUMPSRC} $< $@
 
 bmk.ldscript: ${LDSCRIPT}
        ln -sf $< $@
 
 commonlibs: platformlibs userlibs
-userlibs: ${PSEUDOSTUBS}.o
+userlibs: ${PSEUDOSTUBS}.o ${RROBJLIB}/librumprun_base/librumprun_base.a ${RROBJLIB}/librumprun_tester/librumprun_tester.a ${RROBJLIB}/libunwind/libunwind.a
 platformlibs: ${RROBJLIB}/libbmk_core/libbmk_core.a ${RROBJLIB}/libbmk_rumpuser/libbmk_rumpuser.a bmk.ldscript
+rumpkernlibs: ${RROBJLIB}/librumpkern_bmktc/librumpkern_bmktc.a
 compiler_rt: ${RROBJLIB}/libcompiler_rt/libcompiler_rt.a
 
 .PHONY: buildtest
@@ -89,7 +105,7 @@ installkern:
 installuser:
        install -m 0444 ${PSEUDOSTUBS}.o ${INSTALLDIR}/lib
 
-INSTALLTGTS  installkern
+INSTALLTGTS+=  installkern
 ifneq (${KERNONLY},true)
 INSTALLTGTS+=  installuser
 endif
index 291a8af424880852f6f66b8ef0ae54b4aeb5e9d6..288909f0023f88a9be32a0a8f07440a1ab9efb01 100644 (file)
@@ -58,7 +58,7 @@ links:
 
 $(MAINOBJ): $(RUMP_OBJS) platformlibs
        $(CC) -Wl,-r $(CFLAGS) $(LDFLAGS) $(RUMP_OBJS) -nostdlib -o $@ \
-           -L${RROBJLIB}/libbmk_core -L${RROBJLIB}libbmk_rumpuser \
+           -L${RROBJLIB}/libbmk_core -L${RROBJLIB}/libbmk_rumpuser \
            -Wl,--whole-archive -lbmk_rumpuser -lbmk_core -Wl,--no-whole-archive
 
 .PHONY: clean arch_clean