-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
52 lines (42 loc) · 2.2 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
TAR=tar
LDFLAGS += -lspng
CXXFLAGS := -std=c++17 -Wall -Wextra -pedantic -Werror -O3 $(CXXFLAGS)
DEBUG ?= 0
ifeq ($(DEBUG), 1)
CXXFLAGS += -DDEBUG -g
else
CXXFLAGS += -DNDEBUG
endif
all: png2ico
png2ico: png2ico.cpp
$(CXX) $(CXXFLAGS) -o $@ png2ico.cpp $(LDFLAGS)
doc/png2ico.txt: doc/man1/png2ico.1
man -M "`pwd`"/doc png2ico |sed -e $$'s/.\b\\(.\\)/\\1/g' -e 's/\(.*\)/\1'$$'\r/' >$@
release: SHELL=bash
release: maintainer-clean png2ico doc/png2ico.txt
pwd="`pwd`" && pwd="$${pwd##*/}" && cd .. && \
version=$$(sed 's/^.* \([0-9]*-[0-9]*-[0-9]*\) .*$$/\1/' "$$pwd"/VERSION) && \
$(TAR) --owner=0 --group=0 -czf "$$pwd"/png2ico-src-$${version}.tar.gz "$$pwd"/{LICENSE,VERSION,Makefile,README,README.unix,README.win,README.verifying,doc/bmp.txt,doc/man1/png2ico.1,makefile.bcc32,makezlib.bcc32,png2ico.cpp} && \
zip "$$pwd"/png2ico-win-$${version}.zip "$$pwd"/{LICENSE,VERSION,README,README.verifying,doc/png2ico.txt,png2ico.exe}
@echo
@echo '****************************************************************'
@echo 'HAVE YOU UPDATED VERSION IN BOTH THE UNIX AND THE WINDOWS BUILD?'
@echo '****************************************************************'
@echo
clean distclean clobber:
rm -f png2ico *~ doc/*~ doc/man1/*~ *.bak png2ico-src-*.tar.gz* png2ico-win-*.zip*
maintainer-clean: distclean
rm -f doc/png2ico.txt
SIGN_KEY_ID=<[email protected]>
sign:
version=$$(sed 's/^.* \([0-9]*-[0-9]*-[0-9]*\) .*$$/\1/' VERSION) && \
gpg --default-key '$(SIGN_KEY_ID)' --sign --armor --detach-sig --output png2ico-src-$${version}.tar.gz.sig png2ico-src-$${version}.tar.gz && \
gpg --default-key '$(SIGN_KEY_ID)' --sign --armor --detach-sig --output png2ico-win-$${version}.zip.sig png2ico-win-$${version}.zip
# The verify target is only meant for the maintainer to test if the files
# have been properly signed. Do *not* use this target in build scripts to
# feel secure. It's a false sense of security. If the archive is compromised,
# this target may be compromised, too.
verify:
version=$$(sed 's/^.* \([0-9]*-[0-9]*-[0-9]*\) .*$$/\1/' VERSION) && \
gpg --verify png2ico-src-$${version}.tar.gz.sig png2ico-src-$${version}.tar.gz && \
gpg --verify png2ico-win-$${version}.zip.sig png2ico-win-$${version}.zip