forked from rhboot/pesign
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp the makefile system entirely.
It was getting really overwrought, and what I did in efivar seemed to work well, so do a similar thing here. Signed-off-by: Peter Jones <pjones@redhat.com>
- Loading branch information
Showing
13 changed files
with
297 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SRCDIR = $(realpath .) | ||
TOPDIR = $(realpath ..) | ||
|
||
include $(TOPDIR)/Make.version | ||
include $(TOPDIR)/Make.rules | ||
include $(TOPDIR)/Make.defaults | ||
|
||
.%.d : %.c | ||
$(CC) $(cflags) $(CPPFLAGS) -MM -MG -MF $@ $^ | ||
|
||
.%.d : %.S | ||
$(CC) $(cflags) $(CPPFLAGS) -MM -MG -MF $@ $^ | ||
|
||
SOURCES ?= | ||
deps : | ||
echo SOURCES=$(SOURCES) | ||
deps : $(call deps-of,$(filter-out %.h,$(SOURCES))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,83 @@ | ||
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) -cvqs $@ $^ | ||
|
||
% : %.o | ||
$(CC) $(CCLDFLAGS) -o $@ $^ $(foreach lib,$(LIBS),-l$(lib)) $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-l --libs-only-other $(pklib))) -lpthread | ||
% : %.c | ||
|
||
% : | ||
$(CCLD) $(ccldflags) $(CPPFLAGS) -o $@ $^ $(LDLIBS) | ||
|
||
%.so : | ||
$(CC) $(INCDIR) $(BUILDFLAGS) -Wl,-soname,$(SONAME) $(CCLDFLAGS) $^ -o $@ | ||
$(CCLD) $(ccldflags) $(CPPFLAGS) $(SOFLAGS) \ | ||
-Wl,-soname,$@.$(MAJOR_VERSION) \ | ||
-o $@ $^ $(LDLIBS) | ||
|
||
%.o: %.c | ||
$(CC) $(INCDIR) $(BUILDFLAGS) $(CPPFLAGS) -c $< -o $@ | ||
|
||
.%.P : %.c | ||
$(CC) $(INCDIR) $(BUILDFLAGS) $(CPPFLAGS) -M -MM -MF $@ $^ | ||
$(CC) $(cflags) $(CPPFLAGS) -c -o $@ $(filter %.c %.o %.S,$^) | ||
|
||
%.S: %.c | ||
$(CC) $(INCDIR) $(BUILDFLAGS) $(CPPFLAGS) -S $< -o $@ | ||
$(CC) $(cflags) $(CPPFLAGS) -S $< -o $@ | ||
|
||
%.E: %.c | ||
$(CC) $(INCDIR) $(BUILDFLAGS) $(CPPFLAGS) -E $< -o $@ | ||
$(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 $@) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MAJOR_VERSION = 0 | ||
MINOR_VERSION = 110 | ||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
SRCDIR = . | ||
TOPDIR = $(SRCDIR)/.. | ||
SRCDIR = $(realpath .) | ||
TOPDIR = $(realpath ..) | ||
|
||
include $(TOPDIR)/Make.version | ||
include $(TOPDIR)/Make.rules | ||
include $(TOPDIR)/Make.defaults | ||
|
||
SUBDIRS = libdpe | ||
|
||
all : $(SUBDIRS) | ||
clean all install : | ||
for x in $(SUBDIRS) ; do \ | ||
$(MAKE) -C $$x $@ ; \ | ||
done | ||
|
||
$(SUBDIRS) : | ||
$(MAKE) -C $@ TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) | ||
|
||
clean : | ||
@for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done | ||
|
||
install : | ||
@for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done | ||
|
||
install_systemd: | ||
$(MAKE) -C $@ all | ||
|
||
install_sysvinit: | ||
|
||
.PHONY: all $(SUBDIRS) clean install | ||
|
||
include $(TOPDIR)/Make.rules | ||
.PHONY: $(SUBDIRS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
SRCDIR = . | ||
TOPDIR = $(SRCDIR)/.. | ||
SRCDIR = $(realpath .) | ||
TOPDIR = $(realpath ../..) | ||
|
||
include $(TOPDIR)/Make.version | ||
include $(TOPDIR)/Make.rules | ||
include $(TOPDIR)/Make.defaults | ||
|
||
SUBDIRS = libdpe | ||
|
||
all: | ||
|
||
clean: | ||
|
||
install: | ||
$(INSTALL) -d -m 755 $(INSTALLROOT)$(PREFIX)/include/libdpe/ | ||
$(INSTALL) -m 644 *.h $(INSTALLROOT)$(PREFIX)/include/libdpe/ | ||
|
||
install_systemd: | ||
|
||
install_sysvinit: | ||
|
||
include $(TOPDIR)/Make.rules | ||
#install: | ||
# $(INSTALL) -d -m 755 $(INSTALLROOT)$(PREFIX)/include/libdpe/ | ||
# $(INSTALL) -m 644 *.h $(INSTALLROOT)$(PREFIX)/include/libdpe/ |
Oops, something went wrong.