File: Makefile

package info (click to toggle)
dose3 7.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,276 kB
  • sloc: ml: 25,053; python: 605; perl: 391; sh: 347; makefile: 187
file content (91 lines) | stat: -rw-r--r-- 2,927 bytes parent folder | download | duplicates (3)
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

all: apps man

NAME=dose3
# make sure that generated tarballs are labeled according to the state of git
VERSION=$(shell git describe --tags --always --dirty)
DIST_DIR = $(NAME)-$(VERSION)
DIST_TARBALL = $(DIST_DIR).tar.gz

apps:
	@dune build

files=$(shell find src/ \( -name "*.ml" -o -name "*.mli"  -o -name "*.mlt" \) -not -path "src/experimental/*" -type f -print)

fmt:
	ocamlformat --enable-outside-detected-project --inplace ${files}

clean:
	@dune clean
	cd doc && $(MAKE) clean

test:
	@dune runtest

# stuff not not put in a distribution tarball
DIST_EXCLUDE = cudf tests $(wildcard */tests) experimental doc/webpages

INSTALL_STUFF_ = META
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cma _build/doselibs/*.cmi)
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cmxa _build/doselibs/*.cmxs)
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.a)
#INSTALL_STUFF_ += $(wildcard _build/*/*.mli)
INSTALL_STUFF_ += $(wildcard _build/rpm/*.so)

exclude_cudf = $(wildcard _build/doselibs/*cudf* _build/cudf/*)
INSTALL_STUFF = $(filter-out $(exclude_cudf), $(INSTALL_STUFF_))

installlib: META installcudf
	@test -d $(LIBDIR) || mkdir -p $(LIBDIR)
	@test -d $(LIBDIR)/stublibs || mkdir -p $(LIBDIR)/stublibs
	@$(INSTALL) -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF)
	@echo "Install dose librairies to $(LIBDIR)"

install: installlib
	@cd _build/applications ; \
	install -d $(BINDIR) ; \
	for f in $$(ls *.$(OCAMLEXT)) ; do \
		install $(INSTALLOPTS) $$f $(BINDIR)/$${f%.$(OCAMLEXT)}$(EXE) ; \
	done
	@$(LN) $(BINDIR)/distcheck $(BINDIR)/debcheck$(EXE)
	@$(LN) $(BINDIR)/distcheck $(BINDIR)/rpmcheck$(EXE)
	@$(LN) $(BINDIR)/distcheck $(BINDIR)/eclipsecheck$(EXE)
	@echo "Install dose binaries to $(BINDIR)"

uninstalllib:
	@$(OCAMLFIND) remove -destdir $(LIBDIR) $(NAME)
	@echo "Uninstall dose librairies from $(LIBDIR)"

uninstall: uninstalllib uninstallcudf
	@for f in $$(ls *.$(OCAMLEXT)) ; do \
	  rm -f $(BINDIR)/$${f%.$(OCAMLEXT)}$(EXE) ; \
	done
	@rm -f $(BINDIR)/debcheck$(EXE) $(BINDIR)/rpmcheck$(EXE) $(BINDIR)/eclipsecheck$(EXE)
	@echo "Uninstall dose binaries from $(BINDIR)"

dist: ./$(DIST_TARBALL)
./$(DIST_TARBALL):
	@if [ -d ./$(DIST_DIR)/ ] ; then rm -rf ./$(DIST_DIR)/ ; fi
	@if [ -d ./$(DIST_TARBALL) ] ; then rm -f ./$(DIST_TARBALL) ; fi
	@mkdir ./$(DIST_DIR)/ ; git archive --format=tar HEAD | tar -x -C ./$(DIST_DIR)/
	@for f in $(DIST_EXCLUDE) ; do rm -rf ./$(DIST_DIR)/$$f; done
	@tar czf ./$(DIST_TARBALL) ./$(DIST_DIR)
	@rm -rf ./$(DIST_DIR)
	@echo "Distribution tarball: ./$(DIST_TARBALL)"

changelog:
	dch -c CHANGES --package $(NAME) -v $(VERSION)

credits:
	@git log --pretty=format:'%aN        %aE' | LC_ALL=C sort -u | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}';

doc:
	dune build @doc
	$(MAKE) -C doc all

man:
	$(MAKE) -C doc/manpages

.PHONY: \
	common algo pef versioning debian rpm csw doseparseNoRpm doseparse \
	all clean top-level headers test tags install uninstall dist doc man