-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
117 lines (91 loc) · 2.85 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
SHELL = /bin/sh
srcdir := @@SRCDIR@@
objdir := @@OBJDIR@@
.SUFFIXES:
.SUFFIXES: .c .o
DESTDIR :=
CC := @@CC@@
CXX := @@CXX@@
LEX := @@LEX@@
YACC := @@YACC@@
LFLAGS := @@LFLAGS@@
YFLAGS := @@YFLAGS@@ -d -t
CFLAGS := @@CFLAGS@@ -std=c11
CPPFLAGS := @@CPPFLAGS@@
LDFLAGS := -L$(srcdir)/src -L$(objdir) -L. @@LDFLAGS@@
CAT := cat
CP := cp
TAR := tar
RM ?= rm -f
MKDIR := mkdir -p
PKGCONFIG := pkg-config
VERSION := $(shell $(CAT) "$(srcdir)/misc/VERSION")
PACKAGE := $(shell $(CAT) "$(srcdir)/misc/PACKAGE")
HELP2MAN := help2man
DEPS := @@DEPS@@
prefix := @@PREFIX@@
datarootdir := @@DATAROOTDIR@@
datadir := @@DATADIR@@
exec_prefix := @@EXECPREFIX@@
bindir := @@BINDIR@@
sbindir := @@SBINDIR@@
libexecdir := @@LIBEXECDIR@@
docdir := @@DOCDIR@@
infodir := @@INFODIR@@
libdir := @@LIBDIR@@
mandir := @@MANDIR@@
localedir := @@LOCALEDIR@@
sysconfdir := @@SYSCONFDIR@@
all_SRCS := $(wildcard $(srcdir)/src/*.c)
all_HEADERS := $(wildcard $(srcdir)/src/*.h)
package_OBJS := $(addprefix $(objdir)/,$(notdir $(all_SRCS:.c=.o)))
ifeq ($(DEPS),1)
CPPFLAGS += -MMD -MP
endif
CPPFLAGS += -I$(objdir) -I$(srcdir)/src
.PHONY: all
all: $(objdir)/.d $(objdir)/$(PACKAGE) $(objdir)/$(PACKAGE).8
$(objdir)/.d:
@mkdir -p $(objdir)/.d 2>/dev/null
$(objdir)/$(PACKAGE).8: $(objdir)/$(PACKAGE) $(srcdir)/misc/man.extra
-$(HELP2MAN) -i $(srcdir)/misc/man.extra -N -s 8 -S 'FailOS' $< > $@
$(objdir)/$(PACKAGE): $(package_OBJS)
$(CC) $(LDFLAGS) $(package_OBJS) -o $@
.PHONY: install uninstall
install: $(PACKAGE)
$(MKDIR) $(DESTDIR)$(bindir)
$(MKDIR) $(DESTDIR)$(prefix)/lib/tmpfiles.d
$(MKDIR) $(DESTDIR)$(mandir)/man8
$(CP) $(objdir)/$(PACKAGE) $(DESTDIR)$(bindir)/
$(CP) $(srcdir)/misc/tmpfiles-d/*.conf $(DESTDIR)$(prefix)/lib/tmpfiles.d/
$(CP) $(objdir)/$(PACKAGE).8 $(DESTDIR)$(mandir)/man8/
uninstall:
$(RM) $(DESTDIR)$(bindir)/$(PACKAGE)
$(RM) $(DESTDIR)$(mandir)/man8/$(PACKAGE).8
.PHONY: mostlyclean clean distclean maintainer-clean
mostlyclean:
$(RM) $(package_OBJS) $(objdir)/$(PACKAGE)
clean: mostlyclean
$(RM) $(objdir)/$(PACKAGE).8
distclean: clean
$(RM) config.log
$(RM) $(objdir)/config.h{,~} $(objdir)/Makefile
$(RM) -r $(objdir)/.d
maintainer-clean: distclean
$(RM) $(PACKAGE)-$(VERSION).tar.xz
.PHONY: dist
dist:
pushd $(srcdir) >/dev/null ; \
$(TAR) -acf $(objdir)/$(PACKAGE)-$(VERSION).tar.xz \
--transform="s,^./,,;s,^,$(PACKAGE)-$(VERSION)/," \
README.md COPYING src misc Makefile.in configure ; \
popd >/dev/null
$(objdir)/%.o: $(srcdir)/src/%.c
ifeq ($(DEPS),1)
$(CC) -c $(CFLAGS) $(CPPFLAGS) -MF $(objdir)/.d/$*.d $< -o $@
else
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
endif
ifeq ($(DEPS),1)
-include $(all_SRCS:$(srcdir)/src/%.c=$(objdir)/.d/%.d)
endif