aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-12-25 10:15:57 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-12-25 10:15:57 -0500
commitde9a3e90b1e3b442ae7b0993c893d16c82d321d7 (patch)
tree4a96376e48e1b533b9a63070c32bf9de8a5ef38f
parent697609dea50e6d2ee2c48791dfdf8ba42d9b6b22 (diff)
switch to scons for building
-rw-r--r--Makefile33
-rw-r--r--SConstruct35
2 files changed, 35 insertions, 33 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 85beeaa..0000000
--- a/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
1ARCH=$(shell uname -m | sed -e s/i.86/i386/)
2
3INC= -Iinclude
4
5ifeq ($(ARCH),sparc64)
6 CFLAGS= -Wall -g ${INC} -mcpu=v9 -m64
7else
8 CFLAGS= -Wall -g ${INC}
9endif
10
11vpath %.h include/
12vpath %.c src/
13
14.PHONY: clean
15
16TOOLS = ftcat ft2csv ftdump
17
18all: ${TOOLS}
19
20FTCAT_OBJ = ftcat.o timestamp.o
21ftcat: ${FTCAT_OBJ}
22 ${CC} ${CFLAGS} -o ftcat ${FTCAT_OBJ}
23
24FT2CSV_OBJ = ft2csv.o mapping.o timestamp.o
25ft2csv: ${FT2CSV_OBJ}
26 ${CC} ${CFLAGS} -o ft2csv ${FT2CSV_OBJ}
27
28FTDUMP_OBJ = ftdump.o mapping.o timestamp.o
29ftdump: ${FTDUMP_OBJ}
30 ${CC} ${CFLAGS} -o ftdump ${FTDUMP_OBJ}
31
32clean:
33 rm -rf *.o ${TOOLS}
diff --git a/SConstruct b/SConstruct
new file mode 100644
index 0000000..0ccafba
--- /dev/null
+++ b/SConstruct
@@ -0,0 +1,35 @@
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/'
8# #####################################################################
9# Build configuration.
10from os import uname
11
12# sanity check
13(os, _, _, _, arch) = uname()
14if os != 'Linux':
15 print 'Warning: Building ft_tools is only supported on Linux.'
16
17if arch not in ('sparc64', 'i686'):
18 print 'Warning: Building ft_tools is only supported on i686 and sparc64.'
19
20env = Environment(
21 CC = 'gcc',
22 CPPPATH = Split(INCLUDE_DIRS),
23 CCFLAGS = Split(DEBUG_FLAGS)
24)
25
26if arch == 'sparc64':
27 # build 64 bit sparc v9 binaries
28 v9 = Split('-mcpu=v9 -m64')
29 env.Append(CCFLAGS = v9, LINKFLAGS = v9)
30
31# #####################################################################
32# Targets:
33env.Program('ftcat', ['src/ftcat.c', 'src/timestamp.c'])
34env.Program('ft2csv', ['src/ft2csv.c', 'src/timestamp.c', 'src/mapping.c'])
35env.Program('ftdump', ['src/ftdump.c', 'src/timestamp.c', 'src/mapping.c'])