File: Makefile

package info (click to toggle)
unison-2.51%2B4.11.1 2.51.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 4,636 kB
  • sloc: ml: 34,056; objc: 3,605; ansic: 1,400; makefile: 722; python: 430; sh: 80
file content (230 lines) | stat: -rw-r--r-- 6,150 bytes parent folder | download
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
.PHONY: all src

default: text

text:
	$(MAKE) -C src UISTYLE=text

test:
	./src/unison -selftest

all: src

src:
	$(MAKE) -C src

-include src/Makefile.ProjectInfo

docs:
	$(MAKE) -C src UISTYLE=text
	$(MAKE) -C doc

include src/Makefile.OCaml

######################################################################
# Export

ifeq ($(OSARCH),win32)
  BCPHOME=/cygdrive/s
  # BCPHOME=/home/exporting
  EXPORTNATIVE=true
  EXPORTSTATIC=true
else
ifeq ($(OSARCH),win32gnuc)
  BCPHOME=/home/exporting
  EXPORTNATIVE=true
  EXPORTSTATIC=false
else
ifeq ($(OSARCH),linux)
  EXPORTNATIVE=true
  EXPORTSTATIC=false
else
ifeq ($(OSARCH),osx)
  EXPORTNATIVE=true
  EXPORTSTATIC=false
else # Solaris
  EXPORTNATIVE=true
  EXPORTSTATIC=true
endif
endif
  BCPHOME=$(HOME)
endif
endif

EXPORTDIR=$(BCPHOME)/pub/$(NAME)
DOWNLOADAREA=releases
DOWNLOADPARENT=$(EXPORTDIR)/download/$(DOWNLOADAREA)
REALDOWNLOADDIR=$(DOWNLOADPARENT)/$(NAME)-$(VERSION)
BRANCH=$(MAJORVERSION)
EXPORTNAME=$(NAME)-$(VERSION)
# OSX/linux portability
ifeq ($(OSARCH),osx)
	TMP=$(shell mktemp -d -t unison)
else
	TMP=$(shell mktemp -d)
endif
DOWNLOADDIR=/tmp/$(NAME)-$(VERSION)
# DOWNLOADDIR=$(REALDOWNLOADDIR)

# OLD
# Do this when it's time to create a new beta-release from the development trunk
#beta: 
#	@echo "Makefile needs fixing"
#	@exit 1
#	@tools/ask tools/exportmsg.txt
#	(cd ..; svn copy trunk branches/$(BRANCH))
#	(cd ../branches/$(BRANCH); svn commit -m "New release branch")
#	@echo
#	@echo "Press RETURN to export it... "
#	@read JUNK
#	$(MAKE) -C ../branches/$(BRANCH) export

# Do this in a release branch to export a new tarball (e.g., after fixing a bug)
# (builds a beta release)
export:
	@echo
	@echo "CHECKLIST:"
	@echo "  - Bump minor version number in src/Makefile.ProjectInfo"
	@echo "  - Move everything interesting from src/RECENTNEWS to doc/changes.tex"
	@echo ""
	@echo "If all this is done, hit RETURN (otherwise Ctrl-C and do it)"
	@read JUNK
	$(MAKE) $(DOWNLOADDIR)
	$(MAKE) exportdocs
	$(MAKE) exportsources
	(cd $(DOWNLOADDIR); genindexhtml)
	@echo
	@echo "OK to commit?  Press RETURN if yes (Crtl-C if no)..."
	@read JUNK
	$(MAKE) commitexport

commitexport:
	$(MAKE) realcommit
	$(MAKE) mailchanges

realcommit:
	@echo
	@echo Committing new export directory
	mv $(DOWNLOADDIR) $(REALDOWNLOADDIR)
	-chmod -R a+r $(EXPORTDIR)
	-chmod -R g+wr $(EXPORTDIR)
	-chmod -R o-w $(EXPORTDIR)
	-$(RM) $(DOWNLOADPARENT)/beta
	-ln -s $(EXPORTNAME) $(DOWNLOADPARENT)/beta
	(cd $(DOWNLOADPARENT); genindexhtml)

$(DOWNLOADDIR):
	@echo Creating DOWNLOADDIR = $(DOWNLOADDIR)
	@echo
	-mkdir -p $(DOWNLOADDIR)

exportsources:
	git archive --output $(DOWNLOADDIR)/$(EXPORTNAME).tar.gz -- HEAD src

exportdocs:
	-rm -f src/unison
	$(MAKE) -C src UISTYLE=text DEBUGGING=false \
                       NATIVE=$(EXPORTNATIVE) STATIC=$(EXPORTSTATIC)
	-$(RM) src/strings.ml
	$(MAKE) -C doc TEXDIRECTIVES+="\\\\draftfalse" real
	$(MAKE) -C src UISTYLE=text DEBUGGING=false \
                       NATIVE=$(EXPORTNATIVE) STATIC=$(EXPORTSTATIC)
	src/unison -doc news > src/NEWS
	cp doc/unison-manual.ps $(DOWNLOADDIR)/$(EXPORTNAME)-manual.ps
	-cp doc/unison-manual.pdf $(DOWNLOADDIR)/$(EXPORTNAME)-manual.pdf
	cp doc/unison-manual.html $(DOWNLOADDIR)/$(EXPORTNAME)-manual.html
	cp doc/unison-manual.html $(DOWNLOADDIR)/$(NAME)-manual.html

MAILTMP = $(HOME)/mail.tmp

mailchanges: 
	@echo To: $(NAME)-announce@yahoogroups.com,$(NAME)-users@yahoogroups.com \
            > $(MAILTMP)
	@echo Subject: $(NAME) $(VERSION) now available >> $(MAILTMP)
	@echo >> $(MAILTMP)
	@echo Download address: >> $(MAILTMP)
	@echo "  " http://www.cis.upenn.edu/~bcpierce/unison/download.html \
           >> $(MAILTMP)
	@echo >> $(MAILTMP)
	@cat src/NEWS >> $(MAILTMP)
	@src/unison -doc news >> $(MAILTMP)
	@echo "Announcement draft can be found in $(MAILTMP)"

######################################################################
# Export binary for the current architecture
# (this stuff is all probably dead)

EXPORTTMP=$(TMP)/export-$(OSARCH)x.tmp

exportnative:
	-$(RM) -r $(EXPORTTMP)
	cp -r src $(EXPORTTMP)
	$(MAKE) realexportnative
ifeq ($(OSARCH),linux)
	$(MAKE) realexportnative EXPORTSTATIC=true KIND=-static
endif
	$(RM) -r $(EXPORTTMP)

realexportnative:
	-$(MAKE) -C $(EXPORTTMP) clean
	$(MAKE) -C $(EXPORTTMP) UISTYLE=text DEBUGGING=false \
                       NATIVE=$(EXPORTNATIVE) STATIC=$(EXPORTSTATIC)
	-mkdir -p $(DOWNLOADDIR)
	cp $(EXPORTTMP)/$(NAME)$(EXEC_EXT) \
               $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-textui$(EXEC_EXT)
	gzip --best --force -c \
            $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-textui$(EXEC_EXT) \
          > $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-textui$(EXEC_EXT).gz
	$(MAKE) -C $(EXPORTTMP) UISTYLE=gtk2 DEBUGGING=false \
                       NATIVE=$(EXPORTNATIVE) STATIC=$(EXPORTSTATIC)
	cp $(EXPORTTMP)/$(NAME)$(EXEC_EXT) \
               $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-gtkui$(EXEC_EXT)
	gzip --best --force -c \
            $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-gtkui$(EXEC_EXT) \
          > $(DOWNLOADDIR)/$(EXPORTNAME).$(OSARCH)$(KIND)-gtkui$(EXEC_EXT).gz


######################################################################
# Version control

checkin: logmsg remembernews
	git commit -a --file=logmsg
	$(RM) logmsg
	@echo 
	@echo "Remember to do:"
	@echo "   git pull && git push"

remembernews: logmsg
	echo "CHANGES FROM VERSION" $(VERSION) > rc.tmp
	echo >> rc.tmp
	cat logmsg >> rc.tmp
	echo  >> rc.tmp
	echo    ------------------------------- >> rc.tmp
	-cat src/RECENTNEWS >> rc.tmp
	mv -f rc.tmp src/RECENTNEWS

######################################################################
# Misc

depend::
	$(MAKE) -C src depend

clean::
	$(RM) -r *.tmp \
	   *.o *.obj *.cmo *.cmx *.cmi core TAGS *~ *.log \
	   *.aux *.log *.dvi *.out *.backup[0-9] *.bak $(STABLEFLAG)
	$(MAKE) -C doc clean
	$(MAKE) -C src clean

install:
	(cd src; $(MAKE) install)

installtext:
	(cd src; $(MAKE) install UISTYLE=text)

src/$(NAME):
	$(MAKE) -C src

windres:
	windres src/win32rc/unison.rc -O coff src/win32rc/unison.res.lib
	windres src/win32rc/unison.rc -O res src/win32rc/unison.res