Merge branch 'master' of postpeta.pccluster.org:mckernel
This commit is contained in:
40
Makefile.in
Executable file
40
Makefile.in
Executable file
@ -0,0 +1,40 @@
|
||||
TARGET = @TARGET@
|
||||
|
||||
all::
|
||||
@(cd executer/kernel; make modules)
|
||||
@(cd executer/user; make)
|
||||
@case "$(TARGET)" in \
|
||||
attached-mic | builtin-x86 | builtin-mic) \
|
||||
(cd kernel; make) \
|
||||
;; \
|
||||
*) \
|
||||
echo "unknown target $(TARGET)" >&2 \
|
||||
exit 1 \
|
||||
;; \
|
||||
esac
|
||||
|
||||
install::
|
||||
@(cd executer/kernel; make install)
|
||||
@(cd executer/user; make install)
|
||||
@case "$(TARGET)" in \
|
||||
attached-mic | builtin-x86 | builtin-mic) \
|
||||
(cd kernel; make install) \
|
||||
;; \
|
||||
*) \
|
||||
echo "unknown target $(TARGET)" >&2 \
|
||||
exit 1 \
|
||||
;; \
|
||||
esac
|
||||
|
||||
clean::
|
||||
@(cd executer/kernel; make clean)
|
||||
@(cd executer/user; make clean)
|
||||
@case "$(TARGET)" in \
|
||||
attached-mic | builtin-x86 | builtin-mic) \
|
||||
(cd kernel; make clean) \
|
||||
;; \
|
||||
*) \
|
||||
echo "unknown target $(TARGET)" >&2 \
|
||||
exit 1 \
|
||||
;; \
|
||||
esac
|
||||
100
configure.ac
Normal file
100
configure.ac
Normal file
@ -0,0 +1,100 @@
|
||||
AC_PREREQ(2.63)
|
||||
AC_INIT(ppos, 1.00)
|
||||
|
||||
AC_PREFIX_DEFAULT([/opt/ppos])
|
||||
|
||||
AC_ARG_WITH([kernelsrc],
|
||||
AC_HELP_STRING(
|
||||
[--with-kernelsrc=path],[Path to 'kernel src', default is /lib/modules/uname_r/build]),
|
||||
[WITH_KERNELSRC=$withval],[WITH_KERNELSRC=yes])
|
||||
|
||||
AC_ARG_WITH([target],
|
||||
AC_HELP_STRING(
|
||||
[--with-target={attached-mic | builtin-mic | builtin-x86}],[target, default is attached-mic]),
|
||||
[WITH_TARGET=$withval],[WITH_TARGET=yes])
|
||||
|
||||
case "X$WITH_KERNELSRC" in
|
||||
Xyes | Xno | X)
|
||||
WITH_KERNELSRC='/lib/modules/`uname -r`/build'
|
||||
;;
|
||||
X/*)
|
||||
;;
|
||||
*)
|
||||
WITH_KERNELSRC="`pwd`/$WITH_KERNELSRC"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "X$WITH_TARGET" = Xyes -o "X$WITH_TARGET" = Xno; then
|
||||
WITH_TARGET=attached-mic
|
||||
fi
|
||||
|
||||
case $WITH_TARGET in
|
||||
attached-mic)
|
||||
ARCH=`uname -m`
|
||||
AC_PROG_CC
|
||||
if test "X$KERNDIR" = X; then
|
||||
KERNDIR="$prefix/attached/kernel"
|
||||
fi
|
||||
if test "X$BINDIR" = X; then
|
||||
BINDIR="$prefix/bin"
|
||||
fi
|
||||
if test "X$KMODDIR" = X; then
|
||||
KMODDIR="$prefix/kmod"
|
||||
fi
|
||||
;;
|
||||
builtin-mic)
|
||||
ARCH=k1om
|
||||
AC_CHECK_PROG(XCC,
|
||||
[x86_64-$ARCH-linux-gcc],
|
||||
[x86_64-$ARCH-linux-gcc],
|
||||
[no])
|
||||
CC=$XCC
|
||||
if test "X$KERNDIR" = X; then
|
||||
KERNDIR="$prefix/attached/kernel"
|
||||
fi
|
||||
if test "X$BINDIR" = X; then
|
||||
BINDIR="$prefix/attached/bin"
|
||||
fi
|
||||
if test "X$KMODDIR" = X; then
|
||||
KMODDIR="$prefix/attached/kmod"
|
||||
fi
|
||||
;;
|
||||
builtin-x86)
|
||||
ARCH=`uname -m`
|
||||
AC_PROG_CC
|
||||
XCC=$CC
|
||||
if test "X$KERNDIR" = X; then
|
||||
KERNDIR="$prefix/attached/kernel"
|
||||
fi
|
||||
if test "X$BINDIR" = X; then
|
||||
BINDIR="$prefix/bin"
|
||||
fi
|
||||
if test "X$KMODDIR" = X; then
|
||||
KMODDIR="$prefix/kmod"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([target $WITH_TARGET is unknwon])
|
||||
;;
|
||||
esac
|
||||
|
||||
KDIR="$WITH_KERNELSRC"
|
||||
TARGET="$WITH_TARGET"
|
||||
|
||||
AC_SUBST(CC)
|
||||
AC_SUBST(XCC)
|
||||
AC_SUBST(ARCH)
|
||||
AC_SUBST(KDIR)
|
||||
AC_SUBST(TARGET)
|
||||
AC_SUBST(BINDIR)
|
||||
AC_SUBST(KMODDIR)
|
||||
AC_SUBST(KERNDIR)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
executer/user/Makefile
|
||||
executer/kernel/Makefile
|
||||
kernel/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
24
executer/kernel/Makefile.in
Normal file
24
executer/kernel/Makefile.in
Normal file
@ -0,0 +1,24 @@
|
||||
KDIR ?= @KDIR@
|
||||
ARCH ?= @ARCH@
|
||||
src ?= $(shell pwd)
|
||||
KMODDIR=@KMODDIR@
|
||||
|
||||
obj-m += mcctrl.o
|
||||
|
||||
mcctrl-objs := driver.o control.o ikc.o syscall.o
|
||||
|
||||
IHK_BASE=$(src)/../../../ihk
|
||||
EXTRA_CFLAGS = -I$(IHK_BASE)/linux/include -I$(IHK_BASE)/ikc/include -I$(IHK_BASE)/include -I$(src)/../include
|
||||
KBUILD_EXTRA_SYMBOLS = $(IHK_BASE)/linux/core/Module.symvers
|
||||
|
||||
.PHONY: clean install modules
|
||||
|
||||
modules:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(ARCH) modules
|
||||
|
||||
clean:
|
||||
$(RM) .*.cmd *.mod.c *.o *.ko* Module.symvers modules.order -r .tmp*
|
||||
|
||||
install:
|
||||
mkdir -p -m 755 $(KMODDIR)
|
||||
install -m 644 mcctrl.ko $(KMODDIR)
|
||||
19
executer/user/Makefile.in
Normal file
19
executer/user/Makefile.in
Normal file
@ -0,0 +1,19 @@
|
||||
CC=@CC@
|
||||
BINDIR=@BINDIR@
|
||||
CFLAGS=-Wall -O
|
||||
TARGET=mcexec
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
mcexec: mcexec.c
|
||||
$(CC) $(CFLAGS) -pthread -o $@ $^
|
||||
|
||||
clean:
|
||||
$(RM) $(TARGET) *.o
|
||||
|
||||
.PHONY: all clean install
|
||||
|
||||
install:
|
||||
mkdir -p -m 755 $(BINDIR)
|
||||
install -m 755 mcexec $(BINDIR)
|
||||
|
||||
45
kernel/Makefile.in
Normal file
45
kernel/Makefile.in
Normal file
@ -0,0 +1,45 @@
|
||||
BUILD_TARGET ?= @TARGET@
|
||||
KERNDIR=@KERNDIR@
|
||||
SRC = $(CURDIR)
|
||||
|
||||
IHKBASE ?= $(SRC)/../../ihk/cokernel
|
||||
O ?= $(CURDIR)/build
|
||||
V ?= $(VERBOSE)
|
||||
|
||||
KERNEL = kernel.img
|
||||
KERNELS = $(addsuffix /$(KERNEL),$(addprefix $(O)/,$(BUILD_TARGET)))
|
||||
|
||||
SUBCMD_OPTS = V='$(V)'
|
||||
|
||||
$(if $(O),,$(error Specify the compilation target directory))
|
||||
#$(if $(shell ls $(IHKBASE)/Makefile),,\
|
||||
# $(error IHK is not found in $(IHKBASE)))
|
||||
|
||||
.PHONY: all clean depend install
|
||||
|
||||
all: $(O) $(KERNELS)
|
||||
|
||||
$(O):
|
||||
mkdir -p $(O)
|
||||
|
||||
%/kernel.img: %/Makefile
|
||||
@echo 'Building for' $(dir $@)
|
||||
@make --no-print-directory -C $(dir $@) $(SUBCMD_OPTS)
|
||||
|
||||
%/Makefile: Makefile.build FORCE
|
||||
@mkdir -p $(dir $@)
|
||||
@echo 'SRC = $(SRC)' > $@
|
||||
@echo 'IHKBASE = $(IHKBASE)' >> $@
|
||||
@echo 'TARGET = $(notdir $(patsubst %/,%,$(dir $@)))' >> $@
|
||||
@echo 'TARGETDIR = $$(shell echo $$(TARGET) | sed "s/-/\//")' >> $@
|
||||
@cat Makefile.build >> $@
|
||||
@rm -f $(dir $@)/Makefile.dep
|
||||
|
||||
clean:
|
||||
rm -rf $(O)
|
||||
|
||||
install:
|
||||
mkdir -p -m 755 $(KERNDIR)
|
||||
install -m 755 $(O)/$(BUILD_TARGET)/kernel.img $(KERNDIR)/mckernel.img
|
||||
|
||||
FORCE:
|
||||
Reference in New Issue
Block a user