include darcs hash in git's commit message.
[git-darcs-import.git] / GNUmakefile
blobc543310f2f321e7e3b05b9d93539aca523e17a6f
2 # Build darcs
4 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
5 ifneq (config,$(MAKECMDGOALS))
6 include autoconf.mk
7 endif
8 endif
10 ifneq (,$(RTSFLAGS))
11 GHCFLAGS += +RTS $(RTSFLAGS) -RTS
12 endif
14 GHCFLAGS += -Wall -Werror -I. -I./src -i./src
15 GHCFLAGS_src__Darcs__Commands__Record.o = $(filter-out -auto-all,$(GHCFLAGS))
16 GHCFLAGS_src__Darcs__SelectChanges.o = $(filter-out -auto-all,$(GHCFLAGS))
17 GHCFLAGS_src__SHA1.o = $(GHCFLAGS) -no-auto-all -funfolding-use-threshold20
18 ifeq ($(HAVE_CURSES),True)
19 GHCFLAGS_src__Darcs__External.o = $(GHCFLAGS)
20 ifeq ($(HAVE_TERMIO_H),True)
21 # This termio bit is a grim hack for Solaris 10 (at least).
22 # Without it, SGTTY isn't declared. Something in the ghc C headers
23 # which get included before term.h in the generated C is clobbering
24 # it. (If you edit that C and put the curses.h and term.h first, the
25 # error goes away.)
26 GHCFLAGS_src__Darcs__External.o += '-\#include <termio.h>'
27 endif
28 GHCFLAGS_src__Darcs__External.o += '-\#include <curses.h>' '-\#include <term.h>'
29 endif
31 SRC_DIRS:=. ./src ./src/Crypt\
32 ./src/Darcs\
33 ./src/Darcs/Commands\
34 ./src/Darcs/Repository\
35 ./src/Darcs/Patch\
36 ./src/win32\
37 ./src/win32/System\
38 ./src/win32/System/Posix\
40 MODULES_AUTOCONF :=\
41 Autoconf.lhs \
42 Context.hs \
43 Workaround.hs \
45 MODULES_GENERAL :=\
46 ThisVersion.lhs \
47 CommandLine.lhs \
48 URL.hs HTTP.hs DateMatcher.lhs \
49 English.lhs Exec.lhs\
50 FastPackedString.hs FileName.lhs FileSystem.hs IsoDate.lhs \
51 Lcs.lhs OldDate.lhs OldFastPackedString.hs \
52 Printer.lhs \
53 RegChars.lhs \
54 SHA1.lhs Ssh.hs UTF8.lhs \
56 MODULES_CRYPT := SHA256.hs
58 MODULES_DARCS :=\
59 ArgumentDefaults.lhs \
60 Arguments.lhs Bug.lhs \
61 CheckFileSystem.lhs \
62 ColorPrinter.lhs \
63 Commands.lhs CommandsAux.lhs Compat.hs \
64 Diff.lhs Email.hs FilePathUtils.hs \
65 FilePathMonad.lhs \
66 External.hs \
67 Flags.lhs Global.lhs \
68 Hopefully.lhs HopefullyPrivate.lhs \
69 IO.lhs Lock.lhs Patch.lhs \
70 Match.lhs \
71 Population.lhs PopulationData.lhs \
72 PrintPatch.lhs Progress.lhs \
73 RemoteApply.lhs RepoPath.hs \
74 Repository.lhs Resolution.lhs SignalHandler.lhs Test.lhs URL.hs \
75 Sealed.lhs Show.lhs \
76 SlurpDirectory.lhs \
77 SelectChanges.lhs TheCommands.lhs \
78 Utils.lhs \
80 MODULES_PATCH:=\
81 Apply.lhs Bundle.lhs \
82 Commute.lhs Core.lhs \
83 Choices.lhs \
84 Depends.lhs Info.lhs Match.lhs MatchData.lhs \
85 Non.lhs \
86 Ordered.lhs \
87 Patchy.lhs Permutations.lhs \
88 Prim.lhs \
89 Read.lhs ReadMonads.hs Real.lhs Set.lhs Show.lhs \
90 TouchesFiles.lhs Viewing.lhs \
92 MODULES_REPOSITORY:=\
93 ApplyPatches.lhs \
94 Checkpoint.lhs \
95 HashedIO.lhs HashedRepo.lhs \
96 Format.lhs Internal.lhs \
97 InternalTypes.lhs \
98 Motd.lhs Prefs.lhs \
99 Pristine.lhs \
100 DarcsRepo.lhs \
102 MODULES_COMMANDS:=\
103 Add.lhs AmendRecord.lhs Annotate.lhs Apply.lhs \
104 Changes.lhs Check.lhs Convert.lhs Diff.lhs Dist.lhs \
105 Get.lhs Help.lhs Init.lhs MarkConflicts.lhs Mv.lhs Optimize.lhs \
106 Pull.lhs Push.lhs Put.lhs \
107 Record.lhs Remove.lhs Repair.lhs Replace.lhs \
108 Revert.lhs Rollback.lhs \
109 Send.lhs SetPref.lhs \
110 Show.lhs ShowAuthors.lhs ShowBug.lhs \
111 ShowContents.lhs ShowFiles.lhs ShowTags.lhs ShowRepo.lhs \
112 Tag.lhs TrackDown.lhs TransferMode.lhs \
113 Unrecord.lhs Unrevert.lhs WhatsNew.lhs \
115 witnesses: src/Darcs/Patch/Real.hi src/Darcs/Patch/Properties.hi src/Darcs/Patch.hi \
116 src/Darcs/Repository/ApplyPatches.hi src/Darcs/Patch/Bundle.hi \
117 src/Darcs/Patch/Match.hi src/Darcs/Repository/HashedRepo.hi \
118 src/Darcs/Resolution.hi src/Darcs/Patch/Check.hi \
119 src/Darcs/Repository/Pristine.hi src/Darcs/Repository/DarcsRepo.hi
121 DARCS_FILES := $(DARCS_FILES_DEPS)\
122 $(patsubst %,src/%,$(MODULES_AUTOCONF))\
123 $(patsubst %,src/%,$(MODULES_GENERAL))\
124 $(patsubst %,src/Crypt/%,$(MODULES_CRYPT))\
125 $(patsubst %,src/Darcs/%,$(MODULES_DARCS))\
126 $(patsubst %,src/Darcs/Patch/%,$(MODULES_PATCH))\
127 $(patsubst %,src/Darcs/Repository/%,$(MODULES_REPOSITORY))\
128 $(patsubst %,src/Darcs/Commands/%,$(MODULES_COMMANDS))
130 UNIT_FILES := $(DARCS_FILES) src/Darcs/Patch/Test.lhs src/Darcs/Patch/QuickCheck.lhs \
131 src/Darcs/Patch/Unit.lhs src/Darcs/Patch/Properties.lhs src/Darcs/Patch/Check.lhs
133 C_OBJS := $(patsubst %,src/%,c_compat.o maybe_relink.o atomic_create.o fpstring.o umask.o) \
134 src/Crypt/sha2.o src/hscurl.o src/hslibwww.o
136 ifeq ($(SYS), windows)
137 GHCFLAGS += -isrc/win32 -Isrc/win32 -DWIN32
138 DARCS_FILES += src/win32/System/Posix.hs src/win32/System/Posix/Files.hs \
139 src/win32/System/Posix/IO.hs src/win32/CtrlC.hs
140 C_OBJS += src/win32/CtrlC_stub.o src/win32/CtrlC.o
141 UNIT_FILES += src/win32/System/Posix.hs src/win32/System/Posix/Files.hs \
142 src/win32/System/Posix/IO.hs
143 endif
145 ifeq ($(HAVE_MAPI),True)
146 C_OBJS += src/win32/send_email.o
147 CPPFLAGS += -Isrc/win32
148 GHCFLAGS += -DHAVE_MAPI
149 endif
151 DARCS_OBJS := $(patsubst %.hs,%.o,$(patsubst %.lhs,%.o,$(DARCS_FILES)))
152 UNIT_OBJS := $(patsubst %.hs,%.o,$(patsubst %.lhs,%.o,$(UNIT_FILES)))
155 .PHONY: all clean distclean maintainer-clean dist deb test check install \
156 test_shell test_shell_hashed test_shell_format2 \
157 test_perl test_perl_hashed test_perl_format2 \
158 bugs bugs_shell bugs_shell_hashed bugs_shell_format2 \
159 bugs_perl bugs_perl_hashed bugs_perl_format2 \
160 installserver installdocs installbin windowsinstaller \
161 website slowtest witnesses\
162 api-doc-dir
164 config: configure autoconf.mk
166 copy:
167 $(MAKE) install prefix=$(destdir)/$(prefix) \
168 bindir=$(destdir)/$(bindir) \
169 libdir=$(destdir)/$(libdir) \
170 datadir=$(destdir)/$(datadir) \
171 libexecdir=$(destdir)/$(libexecdir)
173 installbin: all
174 test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
175 $(INSTALL) darcs $(DESTDIR)$(bindir)
177 test -d $(DESTDIR)$(sysconfdir)/bash_completion.d || \
178 $(INSTALL) -d $(DESTDIR)$(sysconfdir)/bash_completion.d
179 $(INSTALL_DATA) tools/darcs_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/darcs
181 test -d $(DESTDIR)$(mandir)/man1 || \
182 $(INSTALL) -d $(DESTDIR)$(mandir)/man1
183 $(INSTALL_DATA) doc/darcs.1 $(DESTDIR)$(mandir)/man1/
185 installdocs: doc/manual/darcs.ps doc/manual/patch-theory.pdf doc/manual/index.html
186 test -d $(DESTDIR)$(docdir)/manual || \
187 $(INSTALL) -d $(DESTDIR)$(docdir)/manual
188 $(INSTALL_DATA) doc/manual/* $(DESTDIR)$(docdir)/manual
190 test -d $(DESTDIR)$(docdir)/examples || \
191 $(INSTALL) -d $(DESTDIR)$(docdir)/examples
192 $(INSTALL_DATA) tools/zsh_completion_new $(DESTDIR)$(docdir)/examples/
193 $(INSTALL_DATA) tools/zsh_completion_old $(DESTDIR)$(docdir)/examples/
195 installserver: tools/cgi/darcs.cgi
196 test -d $(DESTDIR)$(libexecdir)/cgi-bin || \
197 $(INSTALL) -d $(DESTDIR)$(libexecdir)/cgi-bin
199 test -d $(DESTDIR)$(sysconfdir)/darcs || \
200 $(INSTALL) -d $(DESTDIR)$(sysconfdir)/darcs
201 test -e $(DESTDIR)$(sysconfdir)/darcs/cgi.conf || \
202 $(INSTALL_DATA) tools/cgi/cgi.conf $(DESTDIR)$(sysconfdir)/darcs/cgi.conf
203 $(INSTALL) tools/cgi/darcs.cgi $(DESTDIR)$(libexecdir)/cgi-bin/darcs.cgi
204 test -d $(DESTDIR)$(datadir)/darcs || \
205 $(INSTALL) -d $(DESTDIR)$(datadir)/darcs
206 test -d $(DESTDIR)$(datadir)/darcs/xslt || \
207 $(INSTALL) -d $(DESTDIR)$(datadir)/darcs/xslt
208 $(INSTALL_DATA) tools/cgi/xslt/*.xslt $(DESTDIR)$(datadir)/darcs/xslt/
209 $(INSTALL_DATA) tools/cgi/xslt/errors.xml $(DESTDIR)$(datadir)/darcs/xslt/
210 $(INSTALL_DATA) tools/cgi/xslt/styles.css $(DESTDIR)$(datadir)/darcs/xslt/styles.css
212 # Debian policy doesn't allow symlinks as configuration files.
213 # test -e $(DESTDIR)$(sysconfdir)/darcs/styles.css || \
214 # ln -s $(datadir)/darcs/xslt/styles.css \
215 # $(DESTDIR)$(sysconfdir)/darcs/styles.css
216 $(INSTALL) -m 644 tools/cgi/xslt/styles.css $(DESTDIR)$(sysconfdir)/darcs/styles.css
218 PREDIST_COPY_FILES := \
219 ChangeLog \
220 AUTHORS \
221 release/STATE \
222 src/Context.hs
224 dist: darcs $(PREDIST_COPY_FILES)
225 REPO_PATH="$$PWD" ./darcs dist --dist-name darcs-$(DARCS_VERSION)
226 ln -sf darcs-$(DARCS_VERSION).tar.gz darcs-latest.tar.gz
228 predist_copy:
229 for F in $(PREDIST_COPY_FILES); do \
230 cp -v "$$REPO_PATH/$$F" .; \
231 done
233 predist: predist_copy doc/manual/darcs.ps doc/darcs.1 doc/manual/index.html distclean
234 rm -fr release/debian
236 deb: darcs
237 rm -rf /tmp/darcs-deb_temp && \
238 ./darcs dist --dist-name darcs-deb_temp && \
239 mv darcs-deb_temp.tar.gz /tmp && \
240 cd /tmp && tar zxf darcs-deb_temp.tar.gz && \
241 cd darcs-deb_temp && debuild && \
242 rm -rf /tmp/darcs-deb_temp
244 #ensure the directory exists for api documentation
245 api-doc-dir:
246 @echo "Creating api-doc directory"
247 @mkdir -p api-doc
249 #generate the api documentation
250 api-doc: api-doc-dir $(DARCS_FILES)
251 @if test $(HADDOCK_VERSION) -lt 2 ; then \
252 echo "You need haddock 2.0.0 or later to build the API documentation" ; \
253 exit 1 ; \
254 else \
255 echo "Generating html" ; \
256 haddock --ignore-all-exports --optghc=-I. --optghc=-I./src --optghc=-i./src --optghc=-D__HADDOCK__ -B `$(GHC) --print-libdir` -o api-doc -h $(filter-out %api-doc-dir,$^) ; \
259 windowsinstaller: darcs doc/manual/index.html release/darcs.nsi
260 echo "!define VERSION $(DARCS_VERSION)" > version.nsi
261 "$(MAKENSIS)" version.nsi release/darcs.nsi
262 rm -f version.nsi
264 darcs: $(DARCS_OBJS) src/darcs.lhs $(C_OBJS)
265 @echo Linking $@ ...
266 @rm -f Main.o Main.hi
267 ifdef VERBOSE
268 $(GHC) $(GHCFLAGS) $(OPTLLDFLAGS) -o $@ $^ $(OPTLLIBS)
269 else
270 @$(GHC) $(GHCFLAGS) $(OPTLLDFLAGS) -o $@ $^ $(OPTLLIBS)
271 endif
273 ghci: $(DARCS_FILES) $(C_OBJS)
274 ghci $(filter-out -Wall,$(GHCFLAGS)) $(OPTLLDFLAGS) src/darcs.lhs $(C_OBJS) $(OPTLLIBS)
275 .PHONY: ghci
277 darcsman: src/darcsman.hs $(C_OBJS) $(DARCS_OBJS)
278 list_authors: src/list_authors.hs $(C_OBJS) $(DARCS_OBJS)
279 microbench: src/microbench.hs $(C_OBJS) $(DARCS_OBJS)
280 make_changelog: src/make_changelog.hs $(C_OBJS) $(DARCS_OBJS)
281 unit: src/unit.lhs $(UNIT_OBJS) $(C_OBJS)
282 preproc: src/preproc.hs $(C_OBJS) $(DARCS_OBJS)
284 TEXSOURCES := preproc src/darcs.lhs src/features.tex \
285 src/switching.tex src/configuring_darcs.tex src/gpl.tex \
286 $(DARCS_FILES) src/building_darcs.tex \
287 src/best_practices.tex
288 src/darcs.tex: $(TEXSOURCES)
289 ./preproc darcs.lhs $(PREPROCHTML) > src/darcs.tex
290 # The following is to prevent both being generated simultaneously, which
291 # confuses texlive:
292 src/darcs_print.pdf: src/darcs_print.ps
293 src/darcs_print.tex: $(TEXSOURCES)
294 ./preproc darcs.lhs > src/darcs_print.tex
295 src/patch-theory.tex: $(TEXSOURCES) $(UNIT_FILES)
296 ./preproc Darcs/Patch/Properties.lhs > src/patch-theory.tex
298 website: doc/manual/darcs.ps doc/manual/patch-theory.pdf doc/manual/index.html doc/manual/bigpage.html \
299 darcs doc/index.html
301 doc/manual/index.html: src/darcs.tex src/gpl.tex doc/darcs.css
302 $(MAKEMANUAL)
303 cp -f doc/darcs.css doc/manual/darcs.css
305 doc/manual/bigpage.html: src/darcs.tex src/gpl.tex doc/darcs.css
306 ln -sf darcs.tex src/bigpage.tex
307 latex2html -split 0 -external_file darcs -prefix big \
308 -no_auto_link -dir doc/manual src/bigpage.tex
309 rm src/bigpage.tex
310 cp -f doc/darcs.css doc/manual/bigpage.css
312 doc/manual/darcs.ps: src/darcs_print.ps
313 cp src/darcs_print.ps doc/manual/darcs.ps
314 doc/manual/darcs.pdf: src/darcs_print.pdf
315 cp src/darcs_print.pdf doc/manual/darcs.pdf
316 doc/manual/patch-theory.pdf: src/patch-theory.pdf
317 cp src/patch-theory.pdf doc/manual/
319 doc/darcs.1: darcsman
320 ./darcsman > $@
322 AUTHORS: list_authors
323 ./list_authors > AUTHORS
325 ChangeLog: make_changelog changelog.in/ChangeLog.old $(wildcard changelog.in/entries/*)
327 set -e; \
328 echo; \
329 rm -f changelog.in/entries/*~; \
330 ./make_changelog $(wildcard changelog.in/entries/*); \
331 echo; \
332 sed -n '/^darcs (1\.0\.2)$$/,$$p' changelog.in/ChangeLog.old; \
333 ) > $@.tmp
334 mv $@.tmp $@
336 test check: \
337 test_shell_hashed test_shell test_shell_format2 \
338 test_perl test_perl_hashed test_perl_format2 \
339 bugs
341 bugs: bugs_shell_hashed bugs_shell bugs_shell_format2 \
342 bugs_perl bugs_perl_hashed bugs_perl_format2
344 TEST_FILTER_FILE := tests_to_run
345 PERL_HARNESS := perl ../tests/bin/prove --nocolor
346 SHELL_HARNESS := perl ../tests/shell_harness
348 # $1 - description
349 # $2 - setup
350 # $3 - discard
351 # $4 - type
352 # $5 - extension
353 # $6 - harness
354 define harness
355 @echo Running $4 tests on $1 repositories...
356 @chmod -R u+rwx tests-$4-$1.dir || true
357 @rm -rf tests-$4-$1.dir && cp -R tests tests-$4-$1.dir
358 @cd tests-$4-$1.dir && rm -rf .darcs; mkdir .darcs;\
359 $2;\
360 if [ -r $(TEST_FILTER_FILE) ];\
361 then grep "\.$5" $(TEST_FILTER_FILE) | grep -v '^#' | $3 | xargs $6; \
362 else ls *.$5 | sort -r | $3 | xargs $6; fi
363 @echo Done running tests on $1 repositories...
364 endef
366 define bug_harness
367 @echo Demonstrating $4 bugs on $1 repositories...
368 @rm -rf bugs-$4-$1.dir && cp -R bugs bugs-$4-$1.dir
369 @cd bugs-$4-$1.dir && rm -rf .darcs; mkdir .darcs;\
370 $2;\
371 if [ -r $(TEST_FILTER_FILE) ];\
372 then bugs=1 grep "\.$5" $(TEST_FILTER_FILE) | grep -v '^#' | $3 | xargs $6 || true; \
373 else bugs=1 ls *.$5 | sort -r | $3 | xargs $6 || true; fi
374 @echo Done demonstrating bugs on $1 repositories...
375 endef
377 # $1 - description
378 # $2 - setup
379 # $3 - discard
380 shell_harness=$(call harness,$1,$2,$3,shell,sh,$(SHELL_HARNESS))
381 perl_harness=$(call harness,$1,$2,$3,perl,pl,$(PERL_HARNESS))
382 shell_bugs=$(call bug_harness,$1,$2,$3,shell,sh,$(SHELL_HARNESS))
383 perl_bugs=$(call bug_harness,$1,$2,$3,perl,pl,$(PERL_HARNESS))
385 test_network: darcs
386 @echo Running network tests ...
387 @rm -rf tests-network.dir && cp -R tests/network tests-network.dir
388 @cd tests-network.dir && rm -rf .darcs; mkdir .darcs;\
389 if [ -r $(TEST_FILTER_FILE) ];\
390 then bugs=1 grep "\.sh" $(TEST_FILTER_FILE) | grep -v '^#' | xargs $(SHELL_HARNESS); \
391 else bugs=1 ls *.sh | sort -r | xargs $(SHELL_HARNESS); fi
392 @echo Passed network tests.
394 test_shell: darcs
395 $(call shell_harness,old-fashioned,:,cat)
397 # for the format2 tests, we skip the hashed_inventory.sh test, since explicitly
398 # creates the old-fashioned format that's incompatible with darcs-2.
399 test_shell_format2: darcs
400 $(call shell_harness,darcs-2,\
401 echo ALL --darcs-2 >> .darcs/defaults,\
402 grep -v hashed_inventory.sh)
404 test_shell_hashed: darcs
405 $(call shell_harness,hashed,\
406 echo ALL --hashed >> .darcs/defaults,cat)
408 # skip test known to fail on this repo format
409 test_perl: darcs
410 $(call perl_harness,old-fashioned,:,cat)
412 test_perl_format2: darcs
413 $(call perl_harness,darcs-2,\
414 echo ALL --darcs-2 >> .darcs/defaults,cat)
416 test_perl_hashed: darcs
417 $(call perl_harness,hashed,\
418 echo ALL --hashed >> .darcs/defaults,grep -v conflict-doppleganger.pl)
420 bugs_shell: darcs
421 $(call shell_bugs,old-fashioned,:,cat)
423 bugs_shell_format2: darcs
424 $(call shell_bugs,format-2,\
425 echo ALL --darcs-2 >> .darcs/defaults,\
426 grep -v hashed_inventory.sh)
428 bugs_shell_hashed: darcs
429 $(call shell_bugs,hashed,\
430 echo ALL --hashed >> .darcs/defaults,cat)
432 bugs_perl: darcs
433 $(call perl_bugs,old-fashioned,:,cat)
435 bugs_perl_format2: darcs
436 $(call perl_bugs,darcs-2,\
437 echo ALL --darcs-2 >> .darcs/defaults,cat)
439 bugs_perl_hashed: darcs
440 $(call perl_bugs,hashed,\
441 echo ALL --hashed >> .darcs/defaults,cat)
443 test_unit: darcs unit
444 ./unit
446 register:
448 clean:
449 rm -f $(foreach dir,$(SRC_DIRS),$(dir)/*.o $(dir)/*.hi)
450 rm -f unit diff darcs darcs_cgi
451 rm -f stringify
452 rm -f src/darcs.tex src/darcs.dvi src/darcs.aux
453 rm -f src/patch-theory.tex src/patch-theory.aux src/patch-theory.log
454 rm -f src/patch-theory.aux src/patch-theory.toc
455 rm -f src/darcs_print.tex src/darcs_print.log src/darcs_print.aux src/darcs_print.toc
456 rm -f preproc darcsman
457 rm -rf tests/temp* darcs.log darcs.toc
458 rm -f conftest* .depend.bak
459 rm -f src/win32/System/Posix/IO.hs src/win32/System/Posix/Files.hs
460 rm -f version.nsi
461 rm -f list_authors make_changelog
462 rm -rf api-doc
463 #only remove src/Context.hs if we have a darcs inventory to rebuild it from
464 if test -f _darcs/inventory; then rm -f src/Context.hs; fi
465 rm -f TAGS tags
467 distclean: clean
468 rm -rf config.status config.log autoconf.mk config.cache autom4te.cache
469 rm -f doc/manual/darcs.ps doc/manual/darcs.pdf doc/manual/patch-theory.pdf src/Autoconf.lhs Workaround.hs darcs.idv
470 rm -f src/ThisVersion.lhs tools/cgi/README tools/cgi/darcs.cgi tools/cgi/cgi.conf
471 rm -f config.command
473 maintainer-clean: distclean
474 @echo 'This command is intended for maintainers to use; it'
475 @echo 'deletes files that may need special tools to rebuild.'
476 rm -f configure doc/darcs.1 .depend AUTHORS ChangeLog
477 rm -f src/Context.hs
478 rm -f doc/manual/*.html doc/manual/darcs*.??? doc/manual/darcs.lg
479 rm -f doc/manual/darcs.xref c_context.c doc/darcs_print.ps
480 rm -rf tests/test_output
482 configure: configure.ac aclocal.m4
483 autoconf
485 autoconf.mk src/Autoconf.lhs tools/cgi/darcs.cgi : \
486 config.status autoconf.mk.in src/Autoconf.lhs.in tools/cgi/darcs.cgi.in
487 ./config.status
489 config.status: configure
490 @if test -x config.status; then \
491 ./config.status --recheck; \
492 else \
493 echo >&2 "Please run ./configure to setup the build system."; \
494 exit 1; \
497 .depend: $(DARCS_FILES) $(UNIT_FILES)
498 @echo Rebuild dependencies ...
499 @$(GHC) $(GHCFLAGS) -M -optdep-f -optdep.depend $^
501 .depend: autoconf.mk
503 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
504 ifneq (config,$(MAKECMDGOALS))
505 include .depend
506 endif
507 endif
509 ETAGS = hasktags -e
510 CTAGS = hasktags -c
511 # This follows what autoconf does.
512 # Fixme: Generate correct list of .c files and depend on that.
513 .PHONY: CTAGS ctags tags
514 tags: TAGS
515 TAGS: $(DARCS_FILES)
516 $(ETAGS) $(DARCS_FILES) && etags -a src/*.c
517 ctags: CTAGS
518 CTAGS: $(DARCS_FILES)
519 $(CTAGS) $(DARCS_FILES) && ctags -a src/*.c
520 mv tags tags.unsorted
521 sort tags.unsorted > tags