summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-02-01 12:57:00 -0500
committerTavian Barnes <tavianator@tavianator.com>2019-02-01 12:57:00 -0500
commit3a52c0e1f55d5dd03a00740c191569b9309c0ad6 (patch)
tree65785e4e2e4ff1a0a5ed4ec2f46895d559333616 /Makefile
parent23b55d03ddf69b5ab40dc338c419089e8c64930b (diff)
parent36330d7aab63ef2c202efb0d551f104ed6cefa17 (diff)
downloadbfs-3a52c0e1f55d5dd03a00740c191569b9309c0ad6.tar.xz
Merge branch 'improvements'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 18 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 05665f7..c1249fa 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,9 @@ LOCAL_LDLIBS :=
ifeq ($(OS),Linux)
LOCAL_LDFLAGS += -Wl,--as-needed
LOCAL_LDLIBS += -lacl -lcap -lrt
+
+# These libraries are not build with msan, so disable them
+MSAN_CFLAGS := -DBFS_HAS_SYS_ACL=0 -DBFS_HAS_SYS_CAPABILITY=0
endif
ALL_CPPFLAGS = $(LOCAL_CPPFLAGS) $(CPPFLAGS)
@@ -82,20 +85,29 @@ bfs: \
util.o
$(CC) $(ALL_LDFLAGS) $^ $(ALL_LDLIBS) -o $@
-sanitized: CFLAGS := -g $(WFLAGS) -fsanitize=address -fsanitize=undefined
-sanitized: bfs
-
release: CFLAGS := -g $(WFLAGS) -O3 -flto -DNDEBUG
release: bfs
+tests/mksock: tests/mksock.o
+ $(CC) $(ALL_LDFLAGS) $^ -o $@
+
%.o: %.c
$(CC) $(ALL_CFLAGS) -c $< -o $@
-check: all
+check: all tests/mksock
./tests.sh
+distcheck:
+ +$(MAKE) -Bs check CFLAGS="$(CFLAGS) -fsanitize=undefined -fsanitize=address"
+ifneq ($(OS),Darwin)
+ +$(MAKE) -Bs check CC=clang CFLAGS="$(CFLAGS) $(MSAN_CFLAGS) -fsanitize=memory"
+ +$(MAKE) -Bs check CFLAGS="$(CFLAGS) -m32"
+endif
+ +$(MAKE) -Bs release check
+ +$(MAKE) -Bs check
+
clean:
- $(RM) bfs *.o *.d
+ $(RM) bfs *.[od] tests/mksock tests/*.[od]
install:
$(MKDIR) $(DESTDIR)$(PREFIX)/bin
@@ -107,6 +119,6 @@ uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/bfs
$(RM) $(DESTDIR)$(PREFIX)/share/man/man1/bfs.1
-.PHONY: all release check clean install uninstall
+.PHONY: all release check distcheck clean install uninstall
-include $(wildcard *.d)