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
|
|
|
|
#
|
|
|
|
BUILD_CMD = AR=$(AR) NM=$(NM) OBJCOPY=$(OBJCOPY) \
|
2014-05-23 15:54:04 +00:00
|
|
|
$(RUMP_CONTRIB_DIR)/buildrump.sh -k -V'MAKEVERBOSE=$(VERBOSE_LEVEL)' \
|
2013-12-05 14:45:14 +00:00
|
|
|
$(RUMP_OPT) -s $(RUMP_SRC) -T $(RUMP_TOOLS) -o $(RUMP_OBJ) \
|
|
|
|
-d $(RUMP_BASE)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Linkage
|
|
|
|
#
|
|
|
|
ARCHIVE = $(RUMP_LIB)/librump.a
|
|
|
|
CC_OPT = -DLIBRUMPUSER
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
#
|
|
|
|
$(RUMP_OBJ)/dest: $(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
|
|
|
|
#
|
|
|
|
$(ARCHIVE): $(RUMP_OBJ)/dest
|
|
|
|
@echo "Building rump library ..."
|
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-05-23 15:54:04 +00:00
|
|
|
@cd $(RUMP_CONTRIB_DIR)/nblibs/lib/libc; $(RMAKE) includes
|
|
|
|
@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 :
|