diff options
-rw-r--r-- | Makefile | 33 | ||||
-rw-r--r-- | SConstruct | 35 |
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 @@ | |||
1 | ARCH=$(shell uname -m | sed -e s/i.86/i386/) | ||
2 | |||
3 | INC= -Iinclude | ||
4 | |||
5 | ifeq ($(ARCH),sparc64) | ||
6 | CFLAGS= -Wall -g ${INC} -mcpu=v9 -m64 | ||
7 | else | ||
8 | CFLAGS= -Wall -g ${INC} | ||
9 | endif | ||
10 | |||
11 | vpath %.h include/ | ||
12 | vpath %.c src/ | ||
13 | |||
14 | .PHONY: clean | ||
15 | |||
16 | TOOLS = ftcat ft2csv ftdump | ||
17 | |||
18 | all: ${TOOLS} | ||
19 | |||
20 | FTCAT_OBJ = ftcat.o timestamp.o | ||
21 | ftcat: ${FTCAT_OBJ} | ||
22 | ${CC} ${CFLAGS} -o ftcat ${FTCAT_OBJ} | ||
23 | |||
24 | FT2CSV_OBJ = ft2csv.o mapping.o timestamp.o | ||
25 | ft2csv: ${FT2CSV_OBJ} | ||
26 | ${CC} ${CFLAGS} -o ft2csv ${FT2CSV_OBJ} | ||
27 | |||
28 | FTDUMP_OBJ = ftdump.o mapping.o timestamp.o | ||
29 | ftdump: ${FTDUMP_OBJ} | ||
30 | ${CC} ${CFLAGS} -o ftdump ${FTDUMP_OBJ} | ||
31 | |||
32 | clean: | ||
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. | ||
6 | DEBUG_FLAGS = '-Wall -g -Wdeclaration-after-statement' | ||
7 | INCLUDE_DIRS = 'include/' | ||
8 | # ##################################################################### | ||
9 | # Build configuration. | ||
10 | from os import uname | ||
11 | |||
12 | # sanity check | ||
13 | (os, _, _, _, arch) = uname() | ||
14 | if os != 'Linux': | ||
15 | print 'Warning: Building ft_tools is only supported on Linux.' | ||
16 | |||
17 | if arch not in ('sparc64', 'i686'): | ||
18 | print 'Warning: Building ft_tools is only supported on i686 and sparc64.' | ||
19 | |||
20 | env = Environment( | ||
21 | CC = 'gcc', | ||
22 | CPPPATH = Split(INCLUDE_DIRS), | ||
23 | CCFLAGS = Split(DEBUG_FLAGS) | ||
24 | ) | ||
25 | |||
26 | if 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: | ||
33 | env.Program('ftcat', ['src/ftcat.c', 'src/timestamp.c']) | ||
34 | env.Program('ft2csv', ['src/ft2csv.c', 'src/timestamp.c', 'src/mapping.c']) | ||
35 | env.Program('ftdump', ['src/ftdump.c', 'src/timestamp.c', 'src/mapping.c']) | ||