File: Makefile

package info (click to toggle)
unison 2.48.4-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,452 kB
  • sloc: ml: 31,623; objc: 5,969; ansic: 1,887; makefile: 571; python: 430; sh: 80
file content (392 lines) | stat: -rw-r--r-- 10,824 bytes parent folder | download | duplicates (2)
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
#######################################################################
# $I1: Unison file synchronizer: src/Makefile $
# $I2: Last modified by bcpierce on Sun, 22 Aug 2004 22:29:04 -0400 $
# $I3: Copyright 1999-2004 (see COPYING for details) $
#######################################################################
## User Settings

# Set NATIVE=false if you are not using the native code compiler (ocamlopt)
# This is not advised, though: Unison runs much slower when byte-compiled.
#
# If you set NATIVE=false, then make sure that the THREADS option below is
# also set to false unless your OCaml installation has true posix-compliant
# threads (i.e., -with-pthreads was given as an option to the config script).
NATIVE=true

# Use THREADS=false if your OCaml installation is not configured with the
# -with-pthreads option.  (Unison will crash when compiled with THREADS=true
# if the -with-pthreads configuration option was not used.)
THREADS=false

# User interface style.  For legal values, see Makefile.OCaml.
# You probably don't need to set this yourself -- it will be set to
# an appropriate value automatically, depending on whether the lablgtk
# library is available.
#
# UISTYLE=text

########################################################################
########################################################################
#     (There should be no need to change anything from here on)       ##
########################################################################

######################################################################
# Building installation instructions

all:: strings.ml buildexecutable

all:: INSTALL

.PHONY: all clean install doinstall installtext text \
	setupdemo-old setupdemo modifydemo demo \
	run runbatch runt rundebug runp runtext runsort runprefer \
	prefsdocs runtest repeattest \
	selftest selftestdebug selftestremote testmerge \
	checkin installremote

.DELETE_ON_ERROR:
# to avoid problems when e.g. mkProjectInfo fails to run

INSTALL: $(NAME)$(EXEC_EXT)
# file isn't made for OS X, so check that it's there first
	(if [ -f $(NAME) ]; then ./$(NAME) -doc install > INSTALLATION; fi)

########################################################################
## Miscellaneous developer-only switches
DEBUGGING=true
PROFILING=false
STATIC=false

# NAME, VERSION, and MAJORVERSION, automatically generated
-include Makefile.ProjectInfo

Makefile.ProjectInfo: mkProjectInfo $(wildcard ../.bzr/branch/last-revision)
	./mkProjectInfo > $@

mkProjectInfo: mkProjectInfo.ml
	ocamlc -o $@ unix.cma str.cma $^

clean::
	$(RM) mkProjectInfo
	$(RM) Makefile.ProjectInfo

########################################################################
### Compilation rules

include Makefile.OCaml

######################################################################
# Installation

INSTALLDIR = $(HOME)/bin/

# This has two names because on OSX the file INSTALL shadows the target 'install'!
install: doinstall

installtext: 
	$(MAKE) -C .. installtext

text: 
	$(MAKE) -C .. text

doinstall: $(NAME)$(EXEC_EXT)
	-mv $(INSTALLDIR)/$(NAME)$(EXEC_EXT) /tmp/$(NAME)-$(shell echo $$$$)
	cp $(NAME)$(EXEC_EXT) $(INSTALLDIR)
	cp $(NAME)$(EXEC_EXT) $(INSTALLDIR)$(NAME)-$(MAJORVERSION)$(EXEC_EXT)


######################################################################
# Demo

setupdemo-old: all
	-mkdir alice.tmp bob.tmp
	-touch alice.tmp/letter alice.tmp/curriculum
	-mkdir bob.tmp/curriculum
	-touch bob.tmp/curriculum/french
	-touch bob.tmp/curriculum/german
	-mkdir bob.tmp/good_friends
	-mkdir bob.tmp/good_friends/addresses
	-mkdir alice.tmp/good_friends
	-touch alice.tmp/good_friends/addresses
	-touch bob.tmp/good_friends/addresses/alice
	-mkdir alice.tmp/book
	-mkdir bob.tmp/book
	echo "first name:alice \n 2234 Chesnut Street \n Philadelphia" \
	   > bob.tmp/good_friends/addresses/alice
	echo "ADDRESS 1 : BOB \n firstName : bob \n 2233 Walnut Street" \
	   > alice.tmp/good_friends/addresses
	echo "Born in Paris in 1976 ..." > alice.tmp/curriculum
	echo "Ne a Paris en 1976 ..." > bob.tmp/curriculum/french
	echo "Geboren in Paris im jahre 1976 ..." > bob.tmp/curriculum/german
	echo "Dear friend, I received your letter ..."    > alice.tmp/letter
	echo "And then the big bad wolf" > bob.tmp/book/page3
	echo "Title : three little pigs" > alice.tmp/book/page1
	echo "there was upon a time ..." > alice.tmp/book/page2

setupdemo:
	rm -rf a.tmp b.tmp
	mkdir a.tmp
	touch a.tmp/a a.tmp/b a.tmp/c
	mkdir a.tmp/d
	touch a.tmp/d/f
	touch a.tmp/d/g
	cp -r a.tmp b.tmp

modifydemo:
	-rm a.tmp/a
	echo "Hello" > a.tmp/b
	echo "Hello" > b.tmp/b
	date > b.tmp/c
	echo "Hi there" > a.tmp/d/h
	echo "Hello there" > b.tmp/d/h

demo: all setupdemo
	@$(MAKE) run
	@$(MAKE) modifydemo
	@$(MAKE) run

run: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/x
	-date > b.tmp/y
	./$(NAME) default a.tmp b.tmp

runbatch: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/x
	-date > b.tmp/y
	./$(NAME) default a.tmp b.tmp -batch

runt: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/x
	-date > b.tmp/y
	./$(NAME) default a.tmp b.tmp -timers

rundebug: all
	-date > a.tmp/x
	-date > b.tmp/y
	./$(NAME) a.tmp b.tmp -debug all  -ui text

runp: all
	-echo cat > a.tmp/cat
	-echo cat > b.tmp/cat
	-chmod 765 a.tmp/cat
	-chmod 700 b.tmp/cat
	./$(NAME) a.tmp b.tmp

runtext: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/x
	-date > b.tmp/y
	./$(NAME) -ui text a.tmp b.tmp

runsort: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/b
	-date > b.tmp/m
	-date > b.tmp/z
	-date > b.tmp/f
	-date >> b.tmp/f
	-date > b.tmp/c.$(shell echo $$$$)
	-date > b.tmp/y.$(shell echo $$$$)
	./$(NAME) default a.tmp b.tmp -debug sort

runprefer: all
	-mkdir a.tmp b.tmp
	-date > a.tmp/b
	-date > b.tmp/m
	-date > b.tmp/z
	-echo Hello > a.tmp/z
	-date > b.tmp/f
	-date >> b.tmp/f
	-date > b.tmp/c.$(shell echo $$$$)
	-date > b.tmp/y.$(shell echo $$$$)
	./$(NAME) default a.tmp b.tmp -force b.tmp

prefsdocs: all
	./$(NAME) -prefsdocs 2> prefsdocsjunk.tmp
	mv -f prefsdocsjunk.tmp prefsdocs.tmp

# For developers 
runtest:
	$(MAKE) NATIVE=false DEBUG=true text
	./unison test

repeattest:
	$(MAKE) all NATIVE=false DEBUG=true UISTYLE=text
	./unison noprofile a.tmp b.tmp -repeat foo.tmp -debug ui

selftest:
	$(MAKE) all NATIVE=false DEBUG=true UISTYLE=text
	./unison -selftest -ui text -batch 

selftestdebug:
	$(MAKE) all NATIVE=false DEBUG=true UISTYLE=text
	./unison -selftest -ui text -batch -debug all

selftestremote:
	$(MAKE) all NATIVE=false DEBUG=true UISTYLE=text
	./unison -selftest -ui text -batch test.tmp ssh://eniac.seas.upenn.edu/test.tmp 

testmerge:
	$(MAKE) all NATIVE=false UISTYLE=text
	-rm -rf a.tmp b.tmp
	-rm -rf $(HOME)/.unison/backup/file.txt*
	mkdir a.tmp b.tmp
	@echo
	@echo -----------------------------------------------------------
	@echo
	./unison testmerge -ui text -batch
	echo 1OO >> a.tmp/file.txt
	echo 2oo >> a.tmp/file.txt
	echo 3oo >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 7oo >> a.tmp/file.txt
	echo 8oo >> a.tmp/file.txt
	echo 9oo >> a.tmp/file.txt
	echo 0oo >> a.tmp/file.txt
	echo 1oo >> a.tmp/file.txt
	echo 2oo >> a.tmp/file.txt
	echo 3oo >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 7oo >> a.tmp/file.txt
	echo 8oo >> a.tmp/file.txt
	echo 9oo >> a.tmp/file.txt
	echo 0oo >> a.tmp/file.txt
	echo 1oo >> a.tmp/file.txt
	echo 2oo >> a.tmp/file.txt
	echo 3OO >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	./unison testmerge -ui text -batch
	rm a.tmp/file.txt b.tmp/file.txt
	echo 1OO >> a.tmp/file.txt
	echo second >> a.tmp/file.txt
	echo 3oo >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 7oo >> a.tmp/file.txt
	echo 8oo >> a.tmp/file.txt
	echo 9oo >> a.tmp/file.txt
	echo 0oo >> a.tmp/file.txt
	echo 1oo >> a.tmp/file.txt
	echo 2oo >> a.tmp/file.txt
	echo 3oo >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 5oo >> a.tmp/file.txt
	echo 6oo >> a.tmp/file.txt
	echo 7oo >> a.tmp/file.txt
	echo 8oo >> a.tmp/file.txt
	echo 9oo >> a.tmp/file.txt
	echo 0oo >> a.tmp/file.txt
	echo 1oo >> a.tmp/file.txt
	echo 2oo >> a.tmp/file.txt
	echo 3OO >> a.tmp/file.txt
	echo 4oo >> a.tmp/file.txt
	echo ---
	echo 1OO >> b.tmp/file.txt
	echo 2oo >> b.tmp/file.txt
	echo 3oo >> b.tmp/file.txt
	echo 4oo >> b.tmp/file.txt
	echo 5oo >> b.tmp/file.txt
	echo 6oo >> b.tmp/file.txt
	echo 7oo >> b.tmp/file.txt
	echo 8oo >> b.tmp/file.txt
	echo 9oo >> b.tmp/file.txt
	echo 0oo >> b.tmp/file.txt
	echo 1oo >> b.tmp/file.txt
	echo 2oo >> b.tmp/file.txt
	echo 3oo >> b.tmp/file.txt
	echo 4oo >> b.tmp/file.txt
	echo 5oo >> b.tmp/file.txt
	echo 6oo >> b.tmp/file.txt
	echo 5oo >> b.tmp/file.txt
	echo 6oo >> b.tmp/file.txt
	echo 7oo >> b.tmp/file.txt
	echo 8oo >> b.tmp/file.txt
	echo 9oo >> b.tmp/file.txt
	echo 0oo >> b.tmp/file.txt
	echo 1oo >> b.tmp/file.txt
	echo 2oo >> b.tmp/file.txt
	echo 3OO >> b.tmp/file.txt
	echo end >> b.tmp/file.txt
	@echo
	@echo -----------------------------------------------------------
	@echo
	./unison testmerge -ui text -batch -debug files -debug update -debug backup
	@echo
	@echo -----------------------------------------------------------
	@echo
	./unison testmerge -ui text -batch
	@echo
	@echo -----------------------------------------------------------
	@echo
	cat a.tmp/file.txt
	cat b.tmp/file.txt
	cat $(HOME)/.unison/backup/file.txt


######################################################################
# Tags

# In Windows, tags and TAGS are the same, so make tags stops working
# after the first invocation.  The .PHONY declaration makes it work
# again.
.PHONY: tags

tags:
	-if [ -f `which $(ETAGS)` ]; then \
	    $(ETAGS) *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
          ; fi 

all:: TAGS

TAGS:
	$(MAKE) tags

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

clean::
	-$(RM) *.log *.aux *.log *.dvi *.out *.bak
	-$(RM) -r obsolete
	-$(RM) $(NAME) $(NAME).exe
	-$(RM) $(NAME)-blob.o

clean::
	$(MAKE) -C ubase clean
	$(MAKE) -C lwt clean

ifneq ($(strip $(UIMACDIR)),)
clean::
	-(cd $(UIMACDIR); xcodebuild clean)
	-(cd $(UIMACDIR); $(RM) -r build ExternalSettings.xcconfig)
endif

checkin:
	$(MAKE) -C .. checkin

installremote: 
	$(MAKE) UISTYLE=text
	-unison eniac -path current/unison/trunk/src -batch
	ssh eniac.seas.upenn.edu make -C current/unison/trunk/src installtext

####################################################################
# Documentation strings

# Cons up a fake strings.ml if necessary (the real one is generated when
# we build the documentation, but we need to be able to compile the
# executable here to do that!)
strings.ml:
	echo "(* Dummy strings.ml *)" > strings.ml
	echo "let docs = []" >> strings.ml