Commit 497a99b1 authored by Charlie Jacobsen's avatar Charlie Jacobsen
Browse files

build-setup: Remove unneeded platform/ dir, module build.

parent a1952df5
......@@ -26,19 +26,6 @@ AM_COND_IF([ENABLE_KERNEL_TESTS_BUILD],
[AC_MSG_NOTICE([Building kernel tests.])],
[AC_MSG_NOTICE([Not building kernel tests.])])
# Build libasync as kernel module? (in addition to static lib.a)
AC_ARG_ENABLE([kernel_module],
[AS_HELP_STRING([--enable-kernel-module],
[Enable kernel module build (default=no)])],
[],
[enable_kernel_module="no"])
AM_CONDITIONAL(ENABLE_KERNEL_MODULE,
[test "x$enable_kernel_module" = "xyes"])
AM_COND_IF([ENABLE_KERNEL_MODULE],
[AC_MSG_NOTICE([Building kernel module.])],
[AC_MSG_NOTICE([Not building kernel module.])])
# --------------------------------------------------
# Checks for programs.
# --------------------------------------------------
......
......@@ -2,9 +2,9 @@
# phony targets to link the kernel build system in with this one.
# Include all dirs for distribution/tarball
DIST_SUBDIRS = module tests include
DIST_SUBDIRS = tests include
SUBDIRS = include # we manually recur into module and tests
SUBDIRS = include # we manually recur into tests
# Add includes to include search path. (The root of the builddir is necessary to
# add explicitly for the kernel build, because some of the headers are
......@@ -28,7 +28,6 @@ export AM_CPPFLAGS AM_CFLAGS COMMON_SRCS
LIBASYNC_KBUILD=@abs_top_builddir@/src
LIBASYNC_TESTS_KBUILD=@abs_top_builddir@/src/tests
LIBASYNC_KERNEL_MODULE_KBUILD=@abs_top_builddir@/src/module
# These are used in Kbuilds, so they need to be relative paths (boo). They
# are relative to this directory (the build version).
......@@ -36,8 +35,7 @@ LIBASYNC_PATH=libasync.a
LIBFIPC_LIB=$(shell @abs_top_srcdir@/scripts/relpath.py \
$(LIBFIPC_DIR)/lib/libfipc.a @abs_top_builddir@)
export LIBASYNC_TESTS_KBUILD LIBASYNC_KERNEL_MODULE_KBUILD LIBASYNC_PATH
export LIBFIPC_LIB
export LIBASYNC_TESTS_KBUILD LIBASYNC_PATH LIBFIPC_LIB
if ENABLE_KERNEL_TESTS_BUILD
......@@ -48,26 +46,14 @@ MAYBE_CLEAN_TESTS = clean-tests
endif
if ENABLE_KERNEL_MODULE
MAYBE_ALL_MODULE = all-module
MAYBE_INSTALL_MODULE = install-tests
MAYBE_DO_MODULES_INSTALL_MODULE = do-modules-install-module
MAYBE_CLEAN_MODULE = clean-module
endif
# BUILD ------------------------------------------------------------
# Sequence the build, so we build libfipc first
all: all-lib-cp $(MAYBE_ALL_TESTS) $(MAYBE_ALL_MODULE)
# Sequence the build, so we build libasync first
all: all-lib-cp $(MAYBE_ALL_TESTS)
all-tests: all-lib-cp
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) modules
all-module: all-lib-cp
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) modules
all-lib-cp: all-lib
cp $(LIBASYNC_KBUILD)/lib.a $(LIBASYNC_KBUILD)/libasync.a
......@@ -77,16 +63,11 @@ all-lib:
# INSTALL ------------------------------------------------------------
# Move libasync.a into install dir, and conditionally move modules
install-exec-hook: install-libasync $(MAYBE_INSTALL_TESTS) \
$(MAYBE_INSTALL_MODULE)
install-exec-hook: install-libasync $(MAYBE_INSTALL_TESTS)
install-tests: install-setup-dir
$(MAKE) -C tests install-tests D=$(DESTDIR)$(libdir) # manually recur
install-module: install-setup-dir
cp $(LIBASYNC_KERNEL_MODULE_KBUILD)/module/libasync.ko \
$(DESTDIR)$(libdir)
install-libasync: install-setup-dir
cp $(LIBASYNC_KBUILD)/libasync.a $(DESTDIR)$(libdir)
......@@ -95,9 +76,6 @@ install-setup-dir:
# MODULES INSTALL --------------------------------------------------
do-modules-install-module:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) modules_install
do-modules-install:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) modules_install
......@@ -105,20 +83,17 @@ modules_install: $(MAYBE_DO_MODULES_INSTALL) $(MAYBE_DO_MODULES_INSTALL_MODULE)
# CLEAN ------------------------------------------------------------
clean: clean-lib $(MAYBE_CLEAN_TESTS) $(MAYBE_CLEAN_MODULE)
clean: clean-lib $(MAYBE_CLEAN_TESTS)
clean-tests:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) clean
clean-module:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) clean
clean-lib:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KBUILD) clean
rm -f $(LIBASYNC_KBUILD)/libasync.a
.PHONY: all-tests all-module all-lib all-lib-cp \
install-tests install-module install-libasync install-setup-dir \
do-modules-install do-modules-install-module modules_install \
clean-tests clean-lib clean-module
.PHONY: all-tests all-lib all-lib-cp \
install-tests install-libasync install-setup-dir \
do-modules-install modules_install \
clean-tests clean-lib
# Recurse into correct subdir
SUBDIR = $(PLATFORM)
# Include all platforms in a tarball distribution
DIST_SUBDIRS = kernel
# Part of what makes the kernel build more complex is we need to use
# phony targets to link the kernel build system in with this one.
# Include all dirs for distribution/tarball
DIST_SUBDIRS = module tests
# Add includes to include search path. (The root of the builddir is necessary to
# add explicitly for the kernel build, because some of the headers are
# generated by configure.)
AM_CPPFLAGS = \
-I$(abs_top_builddir) \
-I$(abs_top_srcdir)/src/include \
-I$(abs_top_builddir)/src/include \
-I$(LIBFIPC_DIR)/include
AM_CFLAGS = -fno-ipa-cp -fno-ipa-sra
COMMON_SRCS= \
../../common/thc.c \
../../common/thc_ipc.c \
../../common/thcsync.c \
../../common/awe-mapper.c
# Necessary to export so that these variables are available in Kbuilds
export AM_CPPFLAGS AM_CFLAGS COMMON_SRCS
LIBASYNC_KBUILD=@abs_top_builddir@/src/platform/kernel
LIBASYNC_TESTS_KBUILD=@abs_top_builddir@/src/platform/kernel/tests
LIBASYNC_KERNEL_MODULE_KBUILD=@abs_top_builddir@/src/platform/kernel/module
# These are used in Kbuilds, so they need to be relative paths (boo). They
# are relative to this directory (the build version).
LIBASYNC_PATH=libasync.a
LIBFIPC_LIB=$(shell @abs_top_srcdir@/scripts/relpath.py \
$(LIBFIPC_DIR)/lib/libfipc.a @abs_top_builddir@/src/platform/kernel)
export LIBASYNC_TESTS_KBUILD LIBASYNC_KERNEL_MODULE_KBUILD LIBASYNC_PATH
export LIBFIPC_LIB
if ENABLE_KERNEL_TESTS_BUILD
MAYBE_ALL_TESTS = all-tests
MAYBE_INSTALL_TESTS = install-tests
MAYBE_DO_MODULES_INSTALL = do-modules-install
MAYBE_CLEAN_TESTS = clean-tests
endif
if ENABLE_KERNEL_MODULE
MAYBE_ALL_MODULE = all-module
MAYBE_INSTALL_MODULE = install-tests
MAYBE_DO_MODULES_INSTALL_MODULE = do-modules-install-module
MAYBE_CLEAN_MODULE = clean-module
endif
# BUILD ------------------------------------------------------------
# Sequence the build, so we build libfipc first
all: all-lib-cp $(MAYBE_ALL_TESTS) $(MAYBE_ALL_MODULE)
all-tests: all-lib-cp
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) modules
all-module: all-lib-cp
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) modules
all-lib-cp: all-lib
cp $(LIBASYNC_KBUILD)/lib.a $(LIBASYNC_KBUILD)/libasync.a
all-lib:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KBUILD)
# INSTALL ------------------------------------------------------------
# Move libasync.a into install dir, and conditionally move modules
install-exec-hook: install-libasync $(MAYBE_INSTALL_TESTS) \
$(MAYBE_INSTALL_MODULE)
install-tests: install-setup-dir
$(MAKE) -C tests install-tests D=$(DESTDIR)$(libdir) # manually recur
install-module: install-setup-dir
cp $(LIBASYNC_KERNEL_MODULE_KBUILD)/module/libasync.ko \
$(DESTDIR)$(libdir)
install-libasync: install-setup-dir
cp $(LIBASYNC_KBUILD)/libasync.a $(DESTDIR)$(libdir)
install-setup-dir:
$(MKDIR_P) $(DESTDIR)$(libdir)
# MODULES INSTALL --------------------------------------------------
do-modules-install-module:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) modules_install
do-modules-install:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) modules_install
modules_install: $(MAYBE_DO_MODULES_INSTALL) $(MAYBE_DO_MODULES_INSTALL_MODULE)
# CLEAN ------------------------------------------------------------
clean: clean-lib $(MAYBE_CLEAN_TESTS) $(MAYBE_CLEAN_MODULE)
clean-tests:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_TESTS_KBUILD) clean
clean-tests:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KERNEL_MODULE_KBUILD) clean
clean-lib:
$(MAKE) -C $(KDIR) M=$(LIBASYNC_KBUILD) clean
rm -f $(LIBASYNC_KBUILD)/libasync.a
.PHONY: all-tests all-module all-lib all-lib-cp \
install-tests install-module install-libasync install-setup-dir \
do-modules-install do-modules-install-module modules_install \
clean-tests clean-lib clean-module
ASYNC_OBJS_DIR=../src/common
RPC_OBJS_DIR=../../fast-ipc-module/current/tests/rpc
CFLAGS_ipc.o = -O2 -DPOLL -fno-ipa-cp -fno-ipa-sra
CFLAGS_ring-channel.o = -I$(RPC_OBJS_DIR)../../IPC -I$(RING_CHAN_DIR) -fno-ipa-cp -fno-ipa-sra
EXTRA_CFLAGS=-DDEBUG_OUTPUT
obj-y := libasync.o
ccflags-y += -O0 -fno-ipa-cp -fno-ipa-sra -I$(LIBASYNC_DIR)/src/include -I$(LIBASYNC_DIR)/../fast-ipc-module/current/IPC -DUSE_ASYNC
libasync-objs = $(ASYNC_OBJS_DIR)/awe-mapper.o $(ASYNC_OBJS_DIR)/thc.o $(ASYNC_OBJS_DIR)/thcsync.o $(RPC_OBJS_DIR)/../../IPC/ipc.o $(RPC_OBJS_DIR)/../../ring-chan/ring-channel.o
ASYNC_OBJS_DIR=../src/common
RPC_OBJS_DIR=../../fast-ipc-module/current/tests/rpc
CFLAGS_ipc.o = -O2 -DPOLL -fno-ipa-cp -fno-ipa-sra
CFLAGS_ring-channel.o = -I$(RPC_OBJS_DIR)../../IPC -I$(RING_CHAN_DIR) -fno-ipa-cp -fno-ipa-sra
EXTRA_CFLAGS=-DDEBUG_OUTPUT
obj-m := libasync.o
ccflags-y += -O0 -fno-ipa-cp -fno-ipa-sra -I$(LIBASYNC_DIR)/src/include -I$(LIBASYNC_DIR)/../fast-ipc-module/current/IPC -DUSE_ASYNC
libasync-objs = $(ASYNC_OBJS_DIR)/awe-mapper.o $(ASYNC_OBJS_DIR)/thc.o $(ASYNC_OBJS_DIR)/thcsync.o $(RPC_OBJS_DIR)/../../IPC/ipc.o $(RPC_OBJS_DIR)/../../ring-chan/ring-channel.o $(RPC_OBJS_DIR)/callee.o $(RPC_OBJS_DIR)/caller.o $(RPC_OBJS_DIR)/rpc_test.o
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment