-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
68 lines (49 loc) · 2.17 KB
/
Makefile
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
66
67
68
include ../mconfig
include ../build/version.conf
STRIPOPTS ?= -s
ALL_CXXFLAGS=$(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_EXTRA)
ALL_LDFLAGS=$(LDFLAGS) $(LDFLAGS_EXTRA)
ifeq ($(BUILD_SHUTDOWN),yes)
SHUTDOWN=$(SHUTDOWN_PREFIX)shutdown
endif
dinit_objects = dinit.o load-service.o service.o proc-service.o baseproc-service.o control.o dinit-log.o \
dinit-main.o run-child-proc.o options-processing.o dinit-env.o settings.o
objects = $(dinit_objects) dinitctl.o dinitcheck.o shutdown.o dinit-monitor.o
all: dinit dinitctl dinitcheck dinit-monitor $(SHUTDOWN)
../mconfig:
@echo "*** No mconfig, please run make from top level"
@false
dinit: $(dinit_objects)
$(CXX) -o dinit $(dinit_objects) $(ALL_LDFLAGS) $(LDFLAGS_LIBCAP)
dinitctl: dinitctl.o options-processing.o settings.o
$(CXX) -o dinitctl dinitctl.o options-processing.o settings.o $(ALL_LDFLAGS)
dinitcheck: dinitcheck.o options-processing.o settings.o
$(CXX) -o dinitcheck dinitcheck.o options-processing.o settings.o $(ALL_LDFLAGS)
dinit-monitor: dinit-monitor.o
$(CXX) -o dinit-monitor dinit-monitor.o $(ALL_LDFLAGS)
$(SHUTDOWN_PREFIX)shutdown: shutdown.o
$(CXX) -o $(SHUTDOWN_PREFIX)shutdown shutdown.o $(ALL_LDFLAGS)
$(objects): ../build/includes/mconfig.h
$(objects): %.o: %.cc
$(CXX) $(ALL_CXXFLAGS) -MMD -MP -Iincludes -I../dasynq/include -I../build/includes -c $< -o $@
check: ../build/includes/mconfig.h $(dinit_objects)
$(MAKE) -C tests check
check-igr: dinit dinitctl dinitcheck
$(MAKE) -C igr-tests check-igr
run-cppcheck:
cppcheck --std=c++11 -Iincludes -Idasynq --force --enable=all *.cc 2>../cppcheck-report.txt
install: all
install -d $(DESTDIR)$(SBINDIR)
install $(STRIPOPTS) dinit dinitctl dinitcheck dinit-monitor $(SHUTDOWN) $(DESTDIR)$(SBINDIR)
ifeq ($(BUILD_SHUTDOWN),yes)
ln -sf $(SHUTDOWN) $(DESTDIR)$(SBINDIR)/$(SHUTDOWN_PREFIX)halt
ln -sf $(SHUTDOWN) $(DESTDIR)$(SBINDIR)/$(SHUTDOWN_PREFIX)reboot
ln -sf $(SHUTDOWN) $(DESTDIR)$(SBINDIR)/$(SHUTDOWN_PREFIX)soft-reboot
ln -sf $(SHUTDOWN) $(DESTDIR)$(SBINDIR)/$(SHUTDOWN_PREFIX)poweroff
endif
clean:
rm -f *.o *.d
rm -f dinit dinitctl dinitcheck $(SHUTDOWN_PREFIX)shutdown dinit-monitor
$(MAKE) -C tests clean
$(MAKE) -C igr-tests clean
-include $(objects:.o=.d)