Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PKGNAME = zlib-1.2.8
DISTDIR = /opt/duo/build
TEMPDIR = "/tmp/$(PKGNAME)"
CFLAGS = -O2 -Wall -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC
LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
.PHONY: all clean distclean install
all: Makefile
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) install
Makefile: Makefile.duo
mkdir --parents "$(TEMPDIR)"
# Install to tempdir to remove man pages so we don't tarball them later
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix="$(TEMPDIR)" \
--static
clean:
$(MAKE) $(MAKECMDGOALS)
distclean:
$(MAKE) $(MAKECMDGOALS)
install:
rm --recursive "$(TEMPDIR)/share"
rsync --archive --verbose $(TEMPDIR)/* $(DISTDIR)
rmdir $(TEMPDIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.