1- OBJ =\
1+ CORE_OBJ =\
22lib/chooser.o\
3- lib/io.o\
4- lib/nanorq.o\
53lib/nanorq_core.o\
64lib/ops.o\
75lib/params.o\
@@ -13,6 +11,11 @@ lib/tuple.o\
1311lib/uvec.o\
1412deps/obl/oblas_lite.o
1513
14+ OBJ =\
15+ lib/io.o\
16+ lib/nanorq.o\
17+ $(CORE_OBJ )
18+
1619
1720TEST_UTILS =\
1821t/00util/matgen\
@@ -32,7 +35,7 @@ CPPFLAGS = -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64
3235CFLAGS = -O3 -g -std=c11 -Wall -I. -Iinclude -Ideps/
3336CFLAGS += -march=native -funroll-loops -ftree-vectorize -fno-inline -fstack-protector-all -Wno-unused -Wno-sequence-point
3437
35- all : test libnanorq.a $(EXAMPLES )
38+ all : test libnanorq.a libnanorq_core.a $(EXAMPLES )
3639
3740test : encode decode
3841 $(MAKE ) -f example.make
@@ -43,15 +46,15 @@ decode: decode.o libnanorq.a
4346
4447benchmark : benchmark.o $(OBJ )
4548
46- benchmark_core : benchmark_core.o $(OBJ )
49+ benchmark_core : benchmark_core.o $(CORE_OBJ )
4750
48- t/00util/matgen : t/00util/matgen.o $(OBJ )
49- t/00util/repgen : t/00util/repgen.o $(OBJ )
50- t/00util/hdpcgen : t/00util/hdpcgen.o $(OBJ )
51- t/00util/precond : t/00util/precond.o $(OBJ )
52- t/00util/ult : t/00util/ult.o $(OBJ )
53- t/00util/schedgen : t/00util/schedgen.o $(OBJ )
54- t/00util/test_utils : t/00util/test_utils.o $(OBJ )
51+ t/00util/matgen : t/00util/matgen.o $(CORE_OBJ )
52+ t/00util/repgen : t/00util/repgen.o $(CORE_OBJ )
53+ t/00util/hdpcgen : t/00util/hdpcgen.o $(CORE_OBJ )
54+ t/00util/precond : t/00util/precond.o $(CORE_OBJ )
55+ t/00util/ult : t/00util/ult.o $(CORE_OBJ )
56+ t/00util/schedgen : t/00util/schedgen.o $(CORE_OBJ )
57+ t/00util/test_utils : t/00util/test_utils.o $(CORE_OBJ )
5558
5659examples/encode : examples/encode.o $(OBJ )
5760examples/decode : examples/decode.o $(OBJ )
@@ -62,13 +65,16 @@ check: clean $(TEST_UTILS) $(EXAMPLES)
6265 prove -I. -v t/* .t
6366
6467check-nolibc : clean
65- $(MAKE ) libnanorq .a CPPFLAGS=" $( CPPFLAGS) -DNANORQ_NO_LIBC"
68+ $(MAKE ) libnanorq_core .a CPPFLAGS=" $( CPPFLAGS) -DNANORQ_NO_LIBC"
6669 $(MAKE ) $(TEST_UTILS )
6770 prove -I. -v t/10pcmat.t t/20repmat.t t/30precond.t t/35ult.t t/40hdpc.t t/50schedules.t
6871
6972libnanorq.a : $(OBJ )
7073 $(AR ) rcs $@ $(OBJ )
7174
75+ libnanorq_core.a : $(CORE_OBJ )
76+ $(AR ) rcs $@ $(CORE_OBJ )
77+
7278clean :
7379 $(RM ) encode decode lib/* .o deps/obl/* .o * .o * .a * .gcda * .gcno * .gcov callgrind.* * .gperf * .prof * .heap perf.data perf.data.old benchmark benchmark_core $(TEST_UTILS ) $(EXAMPLES )
7480 find . -name ' *.[a,o]' | xargs $(RM )
@@ -114,9 +120,9 @@ bench-core: benchmark_core
114120
115121check-embedded :
116122 $(MAKE ) clean
117- $(MAKE ) libnanorq .a CPPFLAGS=" $( CPPFLAGS) -DNANORQ_NO_LIBC"
118- @echo " --- Undefined symbols in libnanorq .a ---"
119- @nm -u libnanorq .a | grep -E ' \b(malloc|calloc|realloc|free|posix_memalign|__assert_fail)\b' && \
123+ $(MAKE ) libnanorq_core .a CPPFLAGS=" $( CPPFLAGS) -DNANORQ_NO_LIBC"
124+ @echo " --- Undefined symbols in libnanorq_core .a ---"
125+ @nm -u libnanorq_core .a | grep -E ' \b(malloc|calloc|realloc|free|posix_memalign|__assert_fail)\b' && \
120126 (echo " FAIL: libc symbols found in embedded build" && exit 1) || \
121127 echo " PASS: no libc allocator/assert symbols found"
122128
0 commit comments