diff options
| author | Mattias Andrée <m@maandree.se> | 2026-05-08 22:29:35 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-05-08 22:29:35 +0200 |
| commit | 2d3a573977417d917c16742d8d9d8ead047d0ebc (patch) | |
| tree | caeac52856a9df0478e2bee53e5dda1f84422461 /libtest/Makefile | |
| parent | Add DEFAULT_SUPPORT option and improve DEPENDENCIES (diff) | |
| download | librecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.gz librecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.bz2 librecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.xz | |
Misc
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | libtest/Makefile | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/libtest/Makefile b/libtest/Makefile new file mode 100644 index 0000000..1bb870b --- /dev/null +++ b/libtest/Makefile @@ -0,0 +1,78 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OS = linux +# Linux: linux +# Mac OS: macos +# Windows: windows +include ../mk/$(OS).mk + + +OBJ =\ + alloc.o\ + alloc_have_custom.o\ + globals.o\ + libtest_alloc.o\ + libtest_base_pointer.o\ + libtest_check_no_leaks.o\ + libtest_expect_zeroed_on_free.o\ + libtest_force_zero_on_alloc.o\ + libtest_free.o\ + libtest_get_pagesize.o\ + libtest_start_tracking.o\ + libtest_stop_tracking.o\ + libtest_dump_stack.o\ + $(OBJ_BACKTRACE) + +HDR =\ + libtest.h\ + common.h\ + +LOBJ = $(OBJ:.o=.lo) +TOBJ = $(OBJ:.o=.to) +TEST = $(OBJ:.o=.t) + + +all: libtest.a $(TEST) +$(OBJ): $(HDR) +$(LOBJ): $(HDR) +$(TOBJ): $(HDR) +$(TEST): $(HDR) libtest.a + +.c.o: + $(C17) -fno-builtin -c -o $@ $< $(TEST_CFLAGS) $(TEST_CPPFLAGS) + +.c.lo: + $(C17) -fno-builtin -fPIC -c -o $@ $< $(TEST_CFLAGS) $(TEST_CPPFLAGS) + +.c.to: + $(C17) -DTEST -c -o $@ $< $(TEST_CFLAGS) $(TEST_CPPFLAGS) + +.to.t: + $(C17) -o $@ $< libtest.a $(TEST_LDFLAGS) + +.c.t: + $(C17) -DTEST -o $@ $< libtest.a $(TEST_CFLAGS) $(TEST_CPPFLAGS) $(TEST_LDFLAGS) + +libtest.a: $(OBJ) + @rm -f -- $@ + $(AR) rc $@ $(OBJ) + $(AR) ts $@ > /dev/null + +check: $(TEST) + @set -ex;\ + for t in $(TEST); do\ + ./$$t;\ + done + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) + -rm -f -- *.to *.t + +.SUFFIXES: +.SUFFIXES: .lo .o .c .to .t + +.PHONY: all check install uninstall clean |
