File: Makefile

package info (click to toggle)
ocamlrss 2.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: ml: 2,185; makefile: 155
file content (140 lines) | stat: -rw-r--r-- 4,348 bytes parent folder | download | duplicates (2)
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
###############################################################################
#               OCamlrss                                                      #
#                                                                             #
#   Copyright (C) 2004-2013 Institut National de Recherche en Informatique    #
#   et en Automatique. All rights reserved.                                   #
#                                                                             #
#   This program is free software; you can redistribute it and/or modify      #
#   it under the terms of the GNU Lesser General Public License version       #
#   3 as published by the Free Software Foundation.                           #
#                                                                             #
#   This program is distributed in the hope that it will be useful,           #
#   but WITHOUT ANY WARRANTY; without even the implied warranty of            #
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             #
#   GNU Library General Public License for more details.                      #
#                                                                             #
#   You should have received a copy of the GNU Library General Public         #
#   License along with this program; if not, write to the Free Software       #
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA                  #
#   02111-1307  USA                                                           #
#                                                                             #
#   Contact: Maxence.Guesdon@inria.fr                                         #
#                                                                             #
#                                                                             #
###############################################################################

# do not forget to update META file too
VERSION=2.2.2

# do not forget to update META file too
PACKAGES=xmlm,netstring

OF_FLAGS=-package $(PACKAGES)
OCAMLFIND=ocamlfind
OCAML_COMPFLAGS= -annot
OCAMLC=$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAML_COMPFLAGS)
OCAMLOPT=$(OCAMLFIND) ocamlopt $(OF_FLAGS) $(OCAML_COMFLAGS)
OCAMLDOC=$(OCAMLFIND) ocamldoc $(OF_FLAGS)
OCAMLDEP=ocamldep

all:: byte
ifneq ($(wildcard /usr/bin/ocamlopt),)
all:: opt
endif
byte: rss.cma
opt: rss.cmxa rss.cmxs

CMOFILES= \
	rss_types.cmo \
	rss_io.cmo \
	rss.cmo

CMXFILES=$(CMOFILES:.cmo=.cmx)
CMIFILES=$(CMOFILES:.cmo=.cmi)

rss.cma: $(CMIFILES) $(CMOFILES)
	$(OCAMLC) -o $@ -a $(CMOFILES)

rss.cmxa: $(CMIFILES) $(CMXFILES)
	$(OCAMLOPT) -o $@ -a $(CMXFILES)

.PHONY: doc depend

doc: all
	mkdir -p html
	$(OCAMLDOC) -d html -html rss.mli

webdoc: doc
	mkdir -p ../ocamlrss-gh-pages/refdoc
	cp html/* ../ocamlrss-gh-pages/refdoc/
	cp web/index.html web/style.css ../ocamlrss-gh-pages/

.depend depend:
	$(OCAMLDEP) rss*.ml rss*.mli > .depend

ifneq ($(wildcard /usr/bin/ocamlopt),)
rsstest: rss.cmxa rsstest.ml
	$(OCAMLOPT) -linkpkg -o $@ $(OCAML_COMPFLAGS) $^

test: rsstest
	@./rsstest test.rss > t.rss
	@./rsstest t.rss > t2.rss
	@((diff t.rss t2.rss && echo OK) || echo "t.rss and t2.rss differ")
endif

# installation :
################
install:
ifneq ($(wildcard /usr/bin/ocamlopt),)
	$(OCAMLFIND) install rss META LICENSE $(wildcard rss.cmi rss.cma rss.cmxa rss.a rss.cmxs rss.mli rss.cmx)
else
	$(OCAMLFIND) install rss META LICENSE $(wildcard rss.cmi rss.cma rss.mli rss.cmx)
endif


uninstall:
	ocamlfind remove rss

# archive :
###########
archive:
	git archive --prefix=ocamlrss-$(VERSION)/ HEAD | gzip > ../ocamlrss-gh-pages/ocamlrss-$(VERSION).tar.gz

# Cleaning :
############
clean:
	-$(RM) *.cm* *.a *.annot *.o
	-$(RM) -r html
	-$(RM) rsstest t2.rss t.rss

# headers :
###########
HEADFILES=Makefile *.ml *.mli
.PHONY: headers noheaders
headers:
	headache -h header -c .headache_config $(HEADFILES)

noheaders:
	headache -r -c .headache_config $(HEADFILES)

# generic rules :
#################
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly .sch .html .mail

%.cmi:%.mli
	$(OCAMLC) -c $(OCAML_COMPFLAGS) $<

%.cmo:%.ml
	$(OCAMLC) -c $(OCAML_COMPFLAGS) $<

%.cmi %.cmo:%.ml
	$(OCAMLC) -c $(OCAML_COMPFLAGS) $<

%.cmx %.o:%.ml
	$(OCAMLOPT) -c $(OCAML_COMPFLAGS) $<

%.cmxs: %.cmxa
	$(OCAMLOPT) -I . -shared -linkall -o $@ $<

include .depend