forked from rhboot/pesign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Make.rules
86 lines (59 loc) · 1.68 KB
/
Make.rules
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
default : all
.PHONY: default all deps clean install install_systemd install_sysvinit test
include $(TOPDIR)/Make.version
all : deps
deps :
clean :
install :
install_systemd :
install_sysvinit :
test :
%.a :
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $(RANLIBFLAGS) $@
% : %.o
$(CCLD) $(ccldflags) $(CPPFLAGS) -o $@ $^ $(LDLIBS)
%.so :
$(CCLD) $(ccldflags) $(CPPFLAGS) $(SOFLAGS) \
-Wl,-soname,[email protected].$(MAJOR_VERSION) \
-o $@ $^ $(LDLIBS)
%.o: %.c
$(CC) $(cflags) $(CPPFLAGS) -c -o $@ $(filter %.c %.o %.S,$^)
%.S: %.c
$(CC) $(cflags) $(CPPFLAGS) -S $< -o $@
%.E: %.c
$(CC) $(cflags) $(CPPFLAGS) -E $< -o $@
%.c : %.h
.%.d :
define substitute-version =
sed \
-e "s,@@VERSION@@,$(VERSION),g" \
-e "s,@@LIBDIR@@,$(libdir),g" \
-e "s,@@LIBEXECDIR@@,$(libexecdir),g" \
$(1) > $(2)
endef
%.pc : %.pc.in
@$(call substitute-version,$<,$@)
%.spec : %.spec.in
@$(call substitute-version,$<,$@)
%.service : %.service.in
@$(call substitute-version,$<,$@)
%.sysvinit : %.sysvinit.in
@$(call substitute-version,$<,$@)
pkg-config-cflags = \
$(shell if [ -n "$(PKGS)" ]; then $(PKG_CONFIG) --cflags $(PKGS); fi)
pkg-config-ldflags = \
$(shell if [ -n "$(PKGS)" ]; then $(PKG_CONFIG) --libs-only-L --libs-only-other $(PKGS) ; fi)
pkg-config-ldlibs = \
$(shell if [ -n "$(PKGS)" ]; then $(PKG_CONFIG) --libs-only-l $(PKGS) ; fi)
objects-of = \
$(patsubst %.c,%.o,$(1))
define deps-of =
$(foreach src,$(filter %.c,$(1)),$(patsubst %.c,.%.d,$(src))) \
$(foreach src,$(filter %.S,$(1)),$(patsubst %.S,.%.d,$(src)))
endef
$(TOPDIR)/libdpe/%.a $(TOPDIR)/libdpe/% :
$(MAKE) -C $(TOPDIR)/libdpe $(notdir $@)
define get-config =
$(shell git config --local --get "$(NAME).$(1)")
endef