File: Makefile

package info (click to toggle)
cudf 0.10-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 688 kB
  • sloc: ml: 2,509; ansic: 871; makefile: 170; sh: 18
file content (88 lines) | stat: -rw-r--r-- 1,818 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
include Makefile.config

NAME = cudf

DOC = doc/cudf-check.1
SOURCES = $(wildcard */*.ml */*.mli */*.mll */*.mly)
C_LIB_DIR = c-lib
C_LIB_SOURCES = $(wildcard $(C_LIB_DIR)/*.c $(C_LIB_DIR)/*.h)

ifeq ($(DESTDIR),)
INSTALL = dune install
UNINSTALL = dune uninstall
else
DESTDIR:=$(DESTDIR)/
INSTALL = dune install --destdir=$(DESTDIR)
UNINSTALL = dune uninstall --destdir=$(DESTDIR)
endif

DIST_DIR = $(NAME)-$(VERSION)
DIST_TARBALL = $(DIST_DIR).tar.gz

all: doc/cudf-check.1
	dune build

doc/cudf-check.1: doc/cudf-check.pod
	$(MAKE) -C doc/

.PHONY: c-lib c-lib-opt doc
c-lib:
	make -C $(C_LIB_DIR) all
c-lib-opt:
	make -C $(C_LIB_DIR) opt

clean:
	make -C $(C_LIB_DIR) clean
	make -C doc/ clean
	dune clean
	rm -rf $(NAME)-*.gz $(NAME)_*.gz $(NAME)-*/

top-level:
	ledit ocaml -init ./.ocamlinit-cudf

headers: header.txt .headache.conf
	headache -h header.txt -c .headache.conf $(SOURCES) $(C_LIB_SOURCES)

test:
	dune runtest
c-lib-test:
	make -C $(C_LIB_DIR) test

tags: TAGS
TAGS: $(SOURCES)
	otags $^

install:
	$(INSTALL)
	if [ -f $(C_LIB_DIR)/cudf.o ] ; then \
		$(MAKE) -C c-lib/ -e install ; \
	fi

uninstall:
	$(UNINSTALL)
	-rmdir -p $(DESTDIR)$(OCAMLLIBDIR) $(DESTDIR)$(BINDIR)

dist: ./$(DIST_TARBALL)
./$(DIST_TARBALL):
	git archive --format=tar --prefix=$(DIST_DIR)/ HEAD | gzip > $@
	@echo "Distribution tarball: ./$(DIST_TARBALL)"

rpm: ./$(DIST_TARBALL)
	rpmbuild --nodeps -ta $<

distcheck: ./$(DIST_TARBALL)
	tar xzf $<
	$(MAKE) -C ./$(DIST_DIR) all
	$(MAKE) -C ./$(DIST_DIR) test
	$(MAKE) -C ./$(DIST_DIR)/$(C_LIB_DIR)/ all
	$(MAKE) -C ./$(DIST_DIR) install DESTDIR=$(CURDIR)/$(DIST_DIR)/tmp
	rm -rf ./$(DIST_DIR)

doc:
	dune build @doc

world: all c-lib c-lib-opt doc

.PHONY: all world clean top-level headers test tags install uninstall
.PHONY: dep rpm c-lib c-lib-opt dist doc
.NOTPARALLEL: