1 # Apache 2.0 INS-AMU 2015
7 CFLAGS
=$(WFLAGS
) -Wall
-Wextra
-fstrict-aliasing
-Wstrict-aliasing
8 CFLAGS
+=-ansi
-fPIC
$(OPTFLAGS
) $(WFLAGS
) -g
-DSKDEBUG
12 VALGRINDFLAGS
=--error-exitcode
=1 --track-origins
=yes
--leak-check
=full
--show-leak-kinds
=all
14 skmods
=util
test hist solv sys scheme
15 ekobjs
=objs
/lapack.o objs
/blas.o objs
/expokit.o
17 pngs
=$(patsubst %,fig_
%.png
,$(figs
))
18 objects
=$(patsubst %,objs
/sk_
%.o
,$(skmods
)) objs
/randomkit.o
19 testfiles
=$(wildcard test/*.c
)
20 src
=$(wildcard src
/*.c
) $(wildcard include/*.h
) $(wildcard src
/*.f
)
23 all: $(objects
) libsk.so
26 valgrind
$(VALGRINDFLAGS
) .
/sk_tests
29 gdb sk_tests
-ex
"b sk_test_failed"
34 objs
/%.o
: src
/%.c objs
35 $(CC
) $(CFLAGS
) -c
$< -o objs
/$*.o
37 objs
/test_
%.o
: test/test_
%.c
38 $(CC
) $(CFLAGS
) -c
$< -o objs
/test_
$*.o
41 $(FC
) $(FFLAGS
) -c
$< -o objs
/$*.o
44 $(CC
) -shared
$(objects
) -o libsk.so
46 sk_tests
: $(objects
) $(patsubst test/%.c
,objs
/%.o
,$(testfiles
))
47 .
/collect_tests.sh
> sk_tests.c
48 $(CC
) $(CFLAGS
) $(objects
) objs
/test_
*.o sk_tests.c
$(LFLAGS
) -o
$@
53 gnuplot
-e
"set terminal png; set output '$@'" $<
59 rm -rf objs sk_tests sk_tests.c
*.so
tags *.dat
*.png dox
62 head
-n
1 *.c
*.h
*.f
*.pyc