forked from pwsafe/pwsafe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.freebsd
145 lines (107 loc) · 3.64 KB
/
Makefile.freebsd
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Toplevel Makefile for FreeBSD build of PasswordSafe
# Since we use wxWidgets 3.x, while some distros still provide 2.8
# The following need to be set to point to the local build of wxWidgets.
# Alternately, you can just set WX_CONFIG in your shell environment
# export WX_CONFIG=$(HOME)/src/wxWidgets-3.0.2/wx-config
# version numbers are defined in version.wx
include version.wx
export VER_MAJOR
export VER_MINOR
export VER_REV
export VER_SPECIAL
export RELEASENUM := $(VER_MAJOR).$(VER_MINOR)
export RELEASE_SPECIAL := $(VER_SPECIAL)
export RELEASENAME := $(RELEASENUM)$(RELEASE_SPECIAL)
.PHONY: all clean debug-clean release-clean debug release \
unicodedebug unicoderelease deb rpm rpmbuild tar signatures \
dist sha1sums upload upload-sf upload-src-sf upload-github git-tag I18N \
help test debug-test release-test
RELEASEDIR := ./Releases/
PKG_BASE := pwsafe
SRC_TGZ = $(PKG_BASE)-$(RELEASENAME)-src.tgz
MKDIR := mkdir -p
RM := /bin/rm -rf
GIT := git
GZIP := gzip
ECHO := /bin/echo
export NO_YUBI := yes
GPG := /usr/local/bin/gpg
GPG_SIGN := $(GPG) --detach-sign --default-key $(GPG_KEY)
SIGN_CMD := $(foreach file, $(wildcard $(RELEASEDIR)/*$(RELEASENAME)*), $(GPG_SIGN) $(file); )
SHA1SUM := /usr/bin/sha1
SF_UPLOAD_CMD := /usr/local/bin/rsync -avP -e ssh
SF_UPLOAD_DST := $(SF_UPLOAD_ROOT)/Linux-BETA/$(RELEASENUM)
RELTAG = wx$(subst .,_,$(RELEASENAME))
export CPPFLAGS += -std=c++11
export CXXFLAGS += --stdlib=libc++ -I/usr/local/include
export CFLAGS += -I/usr/local/include
export CC = clang
export CXX = clang++
export CPP = clang++
export PLATFORM = FreeBSD
all: I18N unicodedebug unicoderelease
unicodedebug unicoderelease:
$(MAKE) -C src/os/unix $@
$(MAKE) -C src/core $@
$(MAKE) -C src/ui/wxWidgets CONFIG=$@
debug:
$(MAKE) unicodedebug
release:
$(MAKE) unicoderelease
clean: debug-clean release-clean
debug-clean:
$(MAKE) CONFIG=unicodedebug -C src/os/unix clean
$(MAKE) CONFIG=unicodedebug -C src/core clean
$(MAKE) CONFIG=unicodedebug -C src/ui/wxWidgets clean
$(MAKE) CONFIG=unicodedebug -C src/test clean
release-clean:
$(MAKE) CONFIG=unicoderelease -C src/os/unix clean
$(MAKE) CONFIG=unicoderelease -C src/core clean
$(MAKE) CONFIG=unicoderelease -C src/ui/wxWidgets clean
$(MAKE) CONFIG=unicoderelease -C src/test clean
# dist prepares stuff for upload - deprecated for Linux, until
# we find an elegant way to tell deb and rpm distros apart.
dist:
@$(ECHO) "Run 'make deb' or 'make rpm' to build the respective package"
# rpmbuild is called as part of the rpmbuild invocation from install/rpm/Makefile,
# which we call via 'make rpm' from here.
rpmbuild: release I18N help
tar:
@$(MKDIR) $(RELEASEDIR)
@$(GIT) archive --format=tar.gz \
--prefix=$(PKG_BASE)-$(RELEASENAME)/ \
-o $(RELEASEDIR)/$(SRC_TGZ) \
HEAD
@echo "Done."
sha1sums:
(cd $(RELEASEDIR); $(SHA1SUM) *$(RELEASENAME)*)
signatures:
$(SIGN_CMD)
upload: upload-sf upload-src-sf upload-github
upload-sf:
$(SF_UPLOAD_CMD) \
$(wildcard $(RELEASEDIR)/passwordsafe-*$(RELEASENAME)*) \
$(wildcard $(RELEASEDIR)/pwsafe-*$(RELEASENAME)*) \
$(SF_UPLOAD_DST)
upload-github:
@echo $@ TBD
# Uploading source is a separate target as we only want to do this once,
# as opposed to uploading the compiled package, which we need to do per distro.
upload-src-sf:
$(SF_UPLOAD_CMD) \
$(wildcard $(RELEASEDIR)/pwsafe-*$(RELEASENAME)-src*) \
$(SF_UPLOAD_DST)
git-tag:
$(GIT) tag -u $(GPG_KEY) -m "tag wx $(RELEASENAME) release" $(RELEASENAME)
I18N:
$(MAKE) -C src/ui/wxWidgets/I18N mos
help:
$(MAKE) -C help
test: debug-test
debug-test:
$(MAKE) CONFIG=unicodedebug -C src/test
release-test:
$(MAKE) CONFIG=unicoderelease -C src/test
# Local variables:
# mode: makefile
# End: