-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.in
65 lines (49 loc) · 2.17 KB
/
Makefile.in
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SOURCES = $(shell ls src/*.cc)
TEST_SOURCES = $(shell ls test/*.cc)
all: launchd launchctl
launchd: Makefile $(SOURCES)
$(CXX) -I $(OBJDIR) -o $(OBJDIR)/$@ $(TARGET_CXXFLAGS) $(CXXFLAGS) $(SOURCES) $(TARGET_LDADD)
launchctl:
ln -sf launchd launchctl
test-all test-all.ubsan test-all.asan: Makefile $(SOURCES) $(TEST_SOURCES)
$(CXX) -I $(OBJDIR) -I $(OBJDIR)/src -o $(OBJDIR)/$@ \
-DRELAUNCHD_UNIT_TESTS -DKQLITE_TRACE "-DTESTDIR=\"$(OBJDIR)/test\"" "-DTMPDIR=\"$(OBJDIR)/tmp\"" \
$(TARGET_CXXFLAGS) $(CXXFLAGS) $(TEST_SOURCES) $(SOURCES) $(TARGET_LDADD)
check-asan: tmp
$(MAKE) test-all.asan CXXFLAGS="$(CXXFLAGS) -fsanitize=address" TARGET_LDADD="-lasan"
env ASAN_OPTIONS=verbosity=1:detect_stack_use_after_return=1:atexit=1 $(OBJDIR)/test-all.asan -v
check-ubsan: tmp
$(MAKE) test-all.ubsan CXXFLAGS="$(CXXFLAGS) -fsanitize=undefined"
$(OBJDIR)/test-all.ubsan -v
install: launchd
install -m 755 launchd $$DESTDIR$(PREFIX)/sbin
ln -s $(PREFIX)/sbin/launchd $$DESTDIR$(PREFIX)/bin/launchctl
install -d -m 755 $$DESTDIR/var/db/relaunchd
install -d -m 755 $$DESTDIR/$(MANDIR)
install -d -m 755 $$DESTDIR/$(MANDIR)/man8
install -m 644 launchd.8 $$DESTDIR$(MANDIR)/man8/launchd.8
install -d -m 755 $$DESTDIR/$(MANDIR)/man1
install -m 644 man/launchctl.1 $$DESTDIR$(MANDIR)/man1/launchctl.1
install -d -m 755 $$DESTDIR/$(MANDIR)/man5
install -m 644 man/launchd.plist.5 $$DESTDIR$(MANDIR)/man5/launchd.plist.5
check: test-all tmp
./test-all -v
check-valgrind: test-all tmp
valgrind --leak-check=yes ./test-all -v
coverage-report: test-all
./test-all
lcov --capture --directory . --output-file coverage.info --exclude /Library/\* --exclude /opt/homebrew/\* --exclude $(OBJDIR)/test/\*
genhtml coverage.info --output-directory coverage
clang-analyzer-report: clean
scan-build -o ./scan-build --use-c++=clang++ --status-bugs -v $(MAKE) launchd
clean:
rm -f launchd launchctl test-all *.8 *.gcda *.gcno
rm -rf *.dSYM tmp coverage scan-build
distclean: clean
rm -f Makefile config.h
format:
clang-format -i src/*.cc src/*.h src/*.hpp
# TODO: test/*.cc test/*.h test/*.hpp
tmp:
mkdir tmp
.PHONY : all check check-valgrind clean clang-analyzer-report coverage-report distclean format install