cabal init -i should sanitize suggested package name (fix #8404) (#8561)
[cabal.git] / Cabal / Makefile
blobbf89ffd18d46ab3c4b0bc230dd083440b67ecd76
1 VERSION=3.9.0.0
3 #KIND=devel
4 KIND=rc
5 #KIND=cabal-latest
7 PREFIX=/usr/local
8 HC=ghc
9 GHCFLAGS=-Wall -threaded
10 SSH_USER=$(USER)
12 all: build
14 # build the library itself
16 SOURCES=Distribution/*.hs Distribution/Simple/*.hs \
17 Distribution/PackageDescription/*.hs Distribution/Simple/GHC/*.hs \
18 Distribution/Simple/Build/*.hs Distribution/Compat/*.hs \
19 Distribution/Simple/Program/*.hs
20 CONFIG_STAMP=dist/setup-config
21 BUILD_STAMP=dist/build/libHSCabal-$(VERSION).a
22 HADDOCK_STAMP=dist/doc/html/Cabal/index.html
23 SDIST_STAMP=dist/Cabal-$(VERSION).tar.gz
24 DISTLOC=dist/release
25 DIST_STAMP=$(DISTLOC)/Cabal-$(VERSION).tar.gz
27 COMMA=,
29 setup: $(SOURCES) Setup.hs
30 -mkdir -p dist/setup
31 $(HC) $(GHCFLAGS) --make -i. -odir dist/setup -hidir dist/setup Setup.hs \
32 -o setup
34 $(CONFIG_STAMP): setup Cabal.cabal
35 ./setup configure --with-compiler=$(HC) --prefix=$(PREFIX)
37 build: $(BUILD_STAMP)
38 $(BUILD_STAMP): $(CONFIG_STAMP) $(SOURCES)
39 ./setup build
41 install: $(BUILD_STAMP)
42 ./setup install
44 # documentation...
46 haddock: $(HADDOCK_STAMP)
47 $(HADDOCK_STAMP) : $(CONFIG_STAMP) $(BUILD_STAMP)
48 ./setup haddock
50 clean:
51 rm -rf dist/
52 rm -f setup
54 # testing...
56 moduleTest: tests/ModuleTest.hs tests/PackageDescriptionTests.hs
57 mkdir -p dist/test
58 $(HC) --make -Wall -DDEBUG -odir dist/test -hidir dist/test \
59 -itests tests/ModuleTest.hs -o moduleTest
61 #tests: moduleTest clean
62 # cd tests/A && $(MAKE) clean
63 # cd tests/HUnit-1.0 && $(MAKE) clean
64 # cd tests/A && $(MAKE)
65 # cd tests/HUnit-1.0 && $(MAKE)
67 #check:
68 # rm -f moduleTest
69 # $(MAKE) moduleTest
70 # ./moduleTest
72 # distribution...
74 $(SDIST_STAMP) : $(BUILD_STAMP)
75 ./setup sdist
77 dist: $(DIST_STAMP)
78 $(DIST_STAMP) : $(HADDOCK_STAMP) $(SDIST_STAMP)
79 rm -rf $(DISTLOC)
80 mkdir $(DISTLOC)
81 tar -xzf $(SDIST_STAMP) -C $(DISTLOC)/
82 mkdir -p $(DISTLOC)/Cabal-$(VERSION)/doc
83 cp -r dist/doc/html $(DISTLOC)/Cabal-$(VERSION)/doc/API
84 cp ChangeLog.md $(DISTLOC)/Cabal-$(VERSION)/
85 tar --format=ustar -C $(DISTLOC) -czf $(DISTLOC)/Cabal-$(VERSION).tar.gz Cabal-$(VERSION)
86 mkdir $(DISTLOC)/doc
87 mv $(DISTLOC)/Cabal-$(VERSION)/doc/API $(DISTLOC)/doc
88 mv $(DISTLOC)/Cabal-$(VERSION)/ChangeLog.md $(DISTLOC)/
89 rm -r $(DISTLOC)/Cabal-$(VERSION)/
90 @echo "Cabal tarball built: $(DIST_STAMP)"
91 @echo "Release fileset prepared: $(DISTLOC)/"
93 # Out of date, use SFTP
94 #release: $(DIST_STAMP)
95 # scp -r $(DISTLOC) $(SSH_USER)@haskell.org:/home/web/haskell.org/cabal/release/cabal-$(VERSION)
96 # ssh $(SSH_USER)@haskell.org 'cd /home/web/haskell.org/cabal/release && rm -f $(KIND) && ln -s cabal-$(VERSION) $(KIND)'
98 # tags...
100 TAGSSRCDIRS = Distribution Language
101 tags TAGS: $(SOURCES)
102 find $(TAGSSRCDIRS) -name \*.\*hs | xargs hasktags