File: Makefile.in

package info (click to toggle)
lablgtkmathview 0.7.8-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 332 kB
  • sloc: ml: 777; ansic: 177; makefile: 139; xml: 132
file content (140 lines) | stat: -rw-r--r-- 4,053 bytes parent folder | download | duplicates (5)
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
PACKAGE = @PACKAGE@
VERSION = @VERSION@
INCLUDEDIR = @OCAML_INCLUDE_DIR@
PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc
NATIVE = @HAVE_OCAMLOPT@
PREFIX = 
OBJECTS_C = ml_gtk_mathview.o
OBJECTS = gtkMathViewProps.cmo ogtkMathViewProps.cmo gtk_mathview.cmo gtkMathView.cmo gMathView.cmo gMathViewAux.cmo
OBJECTS_OPT = gtkMathViewProps.cmx ogtkMathViewProps.cmx gtkMathView.cmx gtk_mathview.cmx gMathView.cmx gMathViewAux.cmx
GENERATED_FILES = gtkMathViewProps.ml ogtkMathViewProps.ml
NULL =
INST =	\
	META			\
	gMathView.mli		\
	gMathView.cmi		\
	gtkMathView.cmi		\
	gtk_mathview.cmi	\
	gtkMathViewProps.cmi	\
	ogtkMathViewProps.cmi	\
	gMathViewAux.cmi	\
	gMathViewAux.mli	\
	$(NULL)
DIST_FILES = \
  Makefile.in configure.in gMathView.ml gMathView.mli	\
  gMathViewAux.ml gMathViewAux.mli gtkMathView.ml \
  gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
  configure gtkMathView.props
DIST_DIR = $(PACKAGE)-$(VERSION)
DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
REQUIRES = gdome2 lablgtk2
PREDICATES =
SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@

OCAMLFIND = ocamlfind
OCAMLC = $(OCAMLFIND) ocamlc
OCAMLOPT = $(OCAMLFIND) ocamlopt
OCAMLDEP = ocamldep
OCAMLMKLIB = ocamlmklib
OCAML_STUB_DIR = @OCAML_STUB_DIR@

ARCHIVE = $(PACKAGE)
DLL = dll$(ARCHIVE).so

TESTDIR = ./test
TMPDIR = .test
TMPPKGDIR = $(TMPDIR)/$(PACKAGE)

ifeq ($(NATIVE),yes)
world: all opt
else
world: all
endif

all: $(ARCHIVE).cma lib$(ARCHIVE).a $(DLL)
opt: $(ARCHIVE).cmxa $(ARCHIVE).a
test: $(TESTDIR)/test
test.opt: $(TESTDIR)/test.opt

dist:
	rm -rf $(DIST_DIR)/
	mkdir $(DIST_DIR)/
	cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
	-find $(DIST_DIR) -name .svn -type d -exec rm -rf {} \;
	tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
	rm -rf $(DIST_DIR)/

deb: dist
	if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi
	tar xvzf $(DIST_DIR).tar.gz
	(cd $(DIST_DIR)/ && debuild)
	rm -rf $(DIST_DIR)

$(GENERATED_FILES): gtkMathView.props

ml_gtk_mathview.o: ml_gtk_mathview.c
	gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<

.SUFFIXES: .cmo .cmi .cmx .ml .mli

.ml.cmo:
	$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
.mli.cmi:
	$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
.ml.cmx:
	$(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<

%Props.ml o%Props.ml: %.props $(PROPCC)
	$(PROPCC) $<

depend: *.ml *.mli $(GENERATED_FILES)
	$(OCAMLDEP) *.ml *.mli >.depend
include .depend

$(ARCHIVE).cma: $(OBJECTS)
	$(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
$(ARCHIVE).cmxa: $(OBJECTS_OPT)
	$(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
lib$(ARCHIVE).a $(DLL): $(OBJECTS_C)
	$(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)

$(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
	mkdir -p $(TMPPKGDIR)
	cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
	cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
	rm -r $(TMPDIR)

$(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
	mkdir -p $(TMPPKGDIR)
	cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
	cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
	rm -r $(TMPDIR)

install:
	test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; 	\
	if [ "$(PREFIX)" = "" ]; then 						\
		$(OCAMLFIND) install						\
			$(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a		\
			$(DLL) $(INST) $$extra;					\
	else 									\
		mkdir -p $(PREFIX);						\
		$(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX)	\
			$(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a		\
			$(DLL) $(INST) $$extra;					\
	fi

uninstall:
	if [ "$(PREFIX)" = "" ]; then \
		ocamlfind remove $(PACKAGE); \
	else \
		ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
	fi

clean:
	rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
	cd $(TESTDIR) ; make clean
	rm -rf $(TMPDIR)

distclean: clean
	rm -f config.log config.cache config.status Makefile META
	cd $(TESTDIR) ; make distclean