aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-25 15:05:11 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-25 15:05:11 -0500
commit78ae60302b58a40a3ad27084cf8ba0f77b8dcbfd (patch)
treee713062096f8f85c0b8e20423ea688fc8a069fac
parenta466077f928892d2bd28bd13ef39c92ef8553780 (diff)
switch ft_tools to liblitmus-generated Makefile
The liblitmus Makefile generates a config.inc makefile that makes the liblitmus configuration available to third-party projects. This commit switches ft_tools from the old SConstruct (which did all the configuration itself to a much simpler Makefile based on including config.inc. As a new feature, this automatically picks up all compiler options from liblitmus and thus automatically supports cross-compilation.
-rw-r--r--Makefile40
-rw-r--r--SConstruct52
2 files changed, 40 insertions, 52 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..afff4dc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
1# ##############################################################################
2# User variables
3
4# user variables can be specified in the environment or in a .config file
5-include .config
6
7# Where is the LITMUS^RT userspace library source tree?
8LIBLITMUS ?= ../liblitmus2010
9
10# Include default configuration from liblitmus
11# Liblitmus must have been built before ft_tools can be built.
12include ${LIBLITMUS}/inc/config.makefile
13
14# all sources
15vpath %.c src/
16
17# local include files
18CPPFLAGS += -Iinclude/
19
20# ##############################################################################
21# Targets
22
23all = ftcat ft2csv ftdump
24
25.PHONY: all clean
26all: ${all}
27clean:
28 rm -f ${all} *.o *.d
29
30obj-ftcat = ftcat.o timestamp.o
31ftcat: ${obj-ftcat}
32
33obj-ft2csv = ft2csv.o timestamp.o mapping.o
34ft2csv: ${obj-ft2csv}
35
36obj-ftdump = ftdump.o timestamp.o mapping.o
37ftdump: ${obj-ftdump}
38
39# dependency discovery
40include ${LIBLITMUS}/inc/depend.makefile
diff --git a/SConstruct b/SConstruct
deleted file mode 100644
index 97b5761..0000000
--- a/SConstruct
+++ /dev/null
@@ -1,52 +0,0 @@
1# #####################################################################
2# User configuration: Nothing to configure in this version.
3
4# #####################################################################
5# Internal configuration.
6DEBUG_FLAGS = '-Wall -g -Wdeclaration-after-statement'
7INCLUDE_DIRS = 'include/'
8X86_32_FLAGS = '-m32'
9X86_64_FLAGS = '-m64'
10V9_FLAGS = '-mcpu=v9 -m64'
11SUPPORTED_ARCHS = {
12 'sparc64' : V9_FLAGS,
13 'i686' : X86_32_FLAGS,
14 'i386' : X86_32_FLAGS,
15 'x86_64' : X86_64_FLAGS,
16}
17# #####################################################################
18# Build configuration.
19from os import uname, environ
20
21# sanity check
22(os, _, _, _, arch) = uname()
23if os != 'Linux':
24 print 'Error: Building ft_tools is only supported on Linux.'
25 Exit(1)
26
27# override arch if ARCH is set in environment or command line
28if 'ARCH' in ARGUMENTS:
29 arch = ARGUMENTS['ARCH']
30elif 'ARCH' in environ:
31 arch = environ['ARCH']
32
33if arch not in SUPPORTED_ARCHS:
34 print 'Error: Building ft_tools is only supported for the following', \
35 'architectures: %s.' % ', '.join(sorted(SUPPORTED_ARCHS))
36 Exit(1)
37else:
38 print 'Building %s binaries.' % arch
39 arch_flags = Split(SUPPORTED_ARCHS[arch])
40
41env = Environment(
42 CC = 'gcc',
43 CPPPATH = Split(INCLUDE_DIRS),
44 CCFLAGS = Split(DEBUG_FLAGS) + arch_flags,
45 LINKFLAGS = arch_flags,
46)
47
48# #####################################################################
49# Targets:
50env.Program('ftcat', ['src/ftcat.c', 'src/timestamp.c'])
51env.Program('ft2csv', ['src/ft2csv.c', 'src/timestamp.c', 'src/mapping.c'])
52env.Program('ftdump', ['src/ftdump.c', 'src/timestamp.c', 'src/mapping.c'])