2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
include $(REP_DIR)/lib/mk/rump.inc
|
|
|
|
include $(REP_DIR)/lib/import/import-rump.mk
|
|
|
|
|
|
|
|
RUMP_OBJ = $(RUMP_BASE)/obj
|
2014-05-23 15:54:04 +00:00
|
|
|
RUMP_SRC = $(RUMP_CONTRIB_DIR)/src
|
2013-12-05 14:45:14 +00:00
|
|
|
RUMP_TOOLS = $(RUMP_BASE)/tools
|
|
|
|
RMAKE = $(RUMP_TOOLS)/rumpmake
|
|
|
|
|
|
|
|
#
|
|
|
|
# Can be up to 4 for most verbose output
|
|
|
|
#
|
|
|
|
VERBOSE_LEVEL ?= 0
|
|
|
|
|
|
|
|
#
|
|
|
|
# Sources
|
|
|
|
#
|
2014-04-30 13:17:50 +00:00
|
|
|
SRC_CC = dummies.cc hypercall.cc bootstrap.cc io.cc sync.cc misc.cc
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# TARGET to trigger rump build
|
|
|
|
#
|
|
|
|
SOURCE = $(addprefix $(REP_DIR)/src/lib/rump/,$(SRC_CC))
|
|
|
|
|
|
|
|
#
|
|
|
|
# Rump build script
|
|
|
|
#
|
2014-08-14 15:16:06 +00:00
|
|
|
BUILD_CMD = BUILD_CC=cc BUILD_AR=ar BUILD_NM=nm BUILD_OBJCOPY=objcopy \
|
|
|
|
AR=$(AR) NM=$(NM) OBJCOPY=$(OBJCOPY) CC_TARGET=$(shell basename $(CC)) \
|
2014-05-23 15:54:04 +00:00
|
|
|
$(RUMP_CONTRIB_DIR)/buildrump.sh -k -V'MAKEVERBOSE=$(VERBOSE_LEVEL)' \
|
2015-02-19 10:40:41 +00:00
|
|
|
-V'NOGCCERROR=1' $(RUMP_OPT) -V'RUMP_LOCKS_UP=yes' \
|
|
|
|
-s $(RUMP_SRC) -T $(RUMP_TOOLS) -o $(RUMP_OBJ) -d $(RUMP_BASE)
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Linkage
|
|
|
|
#
|
|
|
|
ARCHIVE = $(RUMP_LIB)/librump.a
|
2015-02-18 13:37:13 +00:00
|
|
|
CC_OPT += -DLIBRUMPUSER
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
INCSDIRS = adosfs altq arpa crypto dev evbarm filecorefs fs i386 isofs miscfs \
|
|
|
|
msdosfs net net80211 netatalk netbt netinet netinet6 netipsec \
|
|
|
|
netisdn netkey netmpls netnatm netsmb nfs ntfs ppath prop \
|
|
|
|
protocols rpc rpcsvc ssp sys ufs uvm x86
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make sure include directory exists
|
|
|
|
#
|
|
|
|
$(shell mkdir -p $(RUMP_BASE)/include)
|
|
|
|
|
2014-02-24 12:55:14 +00:00
|
|
|
#
|
|
|
|
# Filter potential ccache call
|
|
|
|
#
|
|
|
|
RUMP_CC = $(filter-out ccache, $(CC))
|
|
|
|
|
2013-12-05 14:45:14 +00:00
|
|
|
#
|
|
|
|
# Build nbmake for host platform
|
|
|
|
#
|
|
|
|
$(RUMP_TOOLS):
|
2014-02-24 12:55:14 +00:00
|
|
|
CC=$(RUMP_CC) $(BUILD_CMD) -N -V RUMP_KERNEL_IS_LIBC=1 tools
|
2013-12-05 14:45:14 +00:00
|
|
|
echo 'CPPFLAGS+=-DMAXPHYS=32768' >> $(RUMP_TOOLS)/mk.conf
|
|
|
|
echo 'CPPFLAGS+= -fPIC' >> $(RUMP_TOOLS)/mk.conf
|
|
|
|
|
|
|
|
#
|
|
|
|
# Setup install directory
|
|
|
|
#
|
2015-02-19 12:53:45 +00:00
|
|
|
$(RUMP_OBJ)/dest.stage: $(RUMP_TOOLS)
|
2014-02-24 12:55:14 +00:00
|
|
|
CC=$(RUMP_CC) $(BUILD_CMD) setupdest
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build librump
|
|
|
|
#
|
2015-02-19 12:53:45 +00:00
|
|
|
$(ARCHIVE): $(RUMP_OBJ)/dest.stage
|
|
|
|
@echo "Building rump library ... $(ARCHIVE)"
|
2014-02-24 12:55:14 +00:00
|
|
|
CC=$(RUMP_CC) $(BUILD_CMD) -k build install
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install kernel, libc, and pthread headers
|
|
|
|
#
|
|
|
|
$(RUMP_BASE)/include/.prepared: $(ARCHIVE)
|
|
|
|
@for i in $(INCSDIRS); do \
|
|
|
|
mkdir -p $(RUMP_BASE)/include/$$i; done
|
|
|
|
@echo "Installing headers ... (this may take a while)"
|
|
|
|
@cd $(RUMP_SRC)/sys; $(RMAKE) -k obj >/dev/null 2>&1
|
|
|
|
@cd $(RUMP_SRC)/sys; $(RMAKE) -k includes >/dev/null 2>&1
|
|
|
|
@cd $(RUMP_SRC)/include; $(RMAKE) -k includes > /dev/null 2>&1
|
2014-08-14 15:16:06 +00:00
|
|
|
@cd $(RUMP_CONTRIB_DIR)/nblibs/lib/libc; $(RMAKE) includes
|
2014-05-23 15:54:04 +00:00
|
|
|
@cd $(RUMP_CONTRIB_DIR)/nblibs/lib/libpthread; $(RMAKE) includes >/dev/null 2>&1
|
2013-12-05 14:45:14 +00:00
|
|
|
@touch $(RUMP_BASE)/include/.prepared
|
|
|
|
|
|
|
|
#
|
|
|
|
# Trigger rump build
|
|
|
|
#
|
|
|
|
$(SOURCE): $(RUMP_BASE)/include/.prepared
|
|
|
|
|
|
|
|
vpath %.cc $(REP_DIR)/src/lib/rump
|
|
|
|
|
|
|
|
# vi:set ft=make :
|