Commit 6d4d95b6 authored by Charlie Jacobsen's avatar Charlie Jacobsen

reorganize: Updates tests build. Multi thread test runs without error.

Re-organization basically complete.
parent 36d4ad54
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
if ENABLE_TEST_BUILD
SUBDIRS += test
endif
DIST_DIRS = src test
DIST_DIRS = src
......@@ -285,14 +285,12 @@ AC_CONFIG_FILES(
src/platform/kernel/module/Kbuild
src/platform/kernel/Kbuild
src/platform/kernel/include/Makefile
src/platform/kernel/test/Makefile
src/platform/user/Makefile
src/platform/user/src/Makefile
src/platform/user/include/Makefile
test/Makefile
test/user/Makefile
test/kernel/Makefile
src/platform/user/test/Makefile
)
AC_OUTPUT
# Include all dirs for distribution/tarball
DIST_SUBDIRS = include src module
DIST_SUBDIRS = include src module test
# Include all dirs. Only include is really needed now for install.
SUBDIRS = include src module
# Recurse into all for install/dist targets
SUBDIRS = include src module test
# Kernel files
KERNEL_INCLUDES = -I$(abs_top_srcdir)/src/platform/kernel/include
......@@ -34,6 +34,11 @@ MAYBE_MODULES_INSTALL = do-modules-install
endif
# TODO: Add kernel tests
if ENABLE_TEST_BUILD
endif
# Sequence the build, so we build the lib first
all: all-lib-cp $(MAYBE_ALL_MODULE)
......
# No kernel tests right now.
# Include all dirs for distribution/tarball
DIST_SUBDIRS = include src
DIST_SUBDIRS = include src test
# Include all dirs. Only include is really needed now for install.
SUBDIRS = include src
# Recurse into all for install/dist targets
SUBDIRS = include src test
# User files. Note that we need to use absolute paths for
# includes because we're jumping back up the directory tree
......@@ -34,3 +34,20 @@ libcap_a_CFLAGS = $(AM_CFLAGS)
lib_LTLIBRARIES = libcap.la
libcap_la_SOURCES = $(USER_SRCS)
libcap_la_LIBADD = $(GLIB_LDFLAGS)
# So this is kind of lame, but in order to set up the
# dependency between the tests and libcap, I need to put
# the crap in here. Boo. (I guess automake always recurs
# first before it does the current script. Maybe that's
# sensible.)
if ENABLE_TEST_BUILD
# Test apps
noinst_PROGRAMS = cap-stuff multi_thrd_cap
cap_stuff_SOURCES = test/cap-stuff.c
multi_thrd_cap_SOURCES = test/multi_thrd_cap.c
# Link with static libcap.a
LDADD = libcap.a $(GLIB_LDFLAGS)
endif
# noinst_PROGRAMS = cap-stuff multi_thrd_cap
# AM_CPPFLAGS = \
# -I$(top_srcdir)/src/include \
# -I$(top_builddir)/src/include \
# -I$(top_srcdir)/src/platform/user/include \
# $(GLIB_INCLUDES)
# # Link with static libcap.a
# LDADD = $(top_builddir)/src/platform/user/libcap.a $(GLIB_LDFLAGS)
# No platform-independent tests right now
SUBDIRS = user $(MAYBE_KERNEL)
DIST_SUBDIRS = user kernel
# Capability test program Makefile
#CC = cc
#libdir = ../lib
#flags = -lpthread -lcap -L $(libdir)
#
#all:
# $(CC) -g -o test-cap cap-stuff.c $(flags)
# $(CC) -g -o mult multi_thrd_cap.c $(flags)
#
#clean:
# rm test-cap
# rm mult
noinst_PROGRAMS = cap-stuff multi_thrd_cap
noinst_HEADERS = \
$(top_srcdir)/include/libcap.h $(top_srcdir)/include/libcap_types.h \
$(top_srcdir)/include/libcap_user.h
AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_INCLUDES)
LDADD = ../../src/user/libcap.la $(GLIB_LDFLAGS)
#
# I suppose this kind of interferes with standard libtool practice, but this
# is what I use to ensure the test executables are linked statically against the
# libcap libs. If you want them to be dynamically linked, set this var empty.
#
AM_LDFLAGS = -static-libtool-libs
Markdown is supported
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