summaryrefslogtreecommitdiffstats
path: root/build.rmk.tmpl
blob: c51085e57230ff895b1bcdaeb7b4261b6edd9b95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#default PREFIX /usr/local
#default BINDIR /bin
#default CC gcc

#ifdef DEBUG
#define OPT_CFLAGS -Og -g
#else
#define OPT_CFLAGS -O2
#endif

cflags = -I lib/libdvec/include -I lib/libhmap/include
		-I lib/libtabular/include -I lib/liballoc/include
		-Wunused-variable -Wunused-function -Wconversion
		#{OPT_CFLAGS} #{EXTRA_CFLAGS} #{TABULAR_EXTRA_CFLAGS}

rule cc
	#{CC} -o $out $in $cflags

target lib/libdvec/build/libdvec.a
	rmk lib/libdvec

target lib/libhmap/build/libhmap.a
	rmk lib/libhmap

target lib/libtabular/build/libtabular.a
	rmk lib/libtabular

target lib/liballoc/build/liballoc.a
	rmk lib/liballoc

target tabular
	cc tabular.c lib/libdvec/build/libdvec.a lib/libhmap/build/libhmap.a
		lib/libtabular/build/libtabular.a lib/liballoc/build/liballoc.a

command clean
	rm -f tabular

command cleanall
	rmk clean
	rmk -C lib/libtabular clean
	rmk -C lib/libhmap clean
	rmk -C lib/libdvec clean

command install
	install -m755 tabular -t "#{DESTDIR}#{PREFIX}#{BINDIR}"

command uninstall
	rm -f "#{DESTDIR}#{PREFIX}#{BINDIR}/tabular"

command all
	rmk tabular