File: Makefile.in

package info (click to toggle)
calendar 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,156 kB
  • ctags: 1,255
  • sloc: ml: 2,296; makefile: 163; sh: 14
file content (273 lines) | stat: -rw-r--r-- 6,929 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
##########################################################################
#                                                                        #
#  This file is part of Calendar.                                        #
#                                                                        #
#  Copyright (C) 2003-2008 Julien Signoles                               #
#                                                                        #
#  you can redistribute it and/or modify it under the terms of the GNU   #
#  Lesser General Public License version 2.1 as published by the         #
#  Free Software Foundation.                                             #
#                                                                        #
#  It 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 Lesser General Public License for more details.                   #
#                                                                        #
#  See the GNU Lesser General Public Licence version 2.1 for more        #
#  details (enclosed in the file LGPL).                                  #
#                                                                        #
##########################################################################

# $Id: Makefile.in,v 1.67 2008/03/17 09:56:41 signoles Exp $

# Used programs
###############

CAMLC	= @OCAMLC@
CAMLOPT	= @OCAMLOPT@
CAMLDEP	= @OCAMLDEP@
CAMLDOC	= @OCAMLDOC@
CAMLWEB	= @OCAMLWEB@
CAMLWC	= @OCAMLWC@
CAMLDOT	= @OCAMLDOT@
CAMLLIB	= @OCAMLLIB@
CAMLFIND= @OCAMLFIND@

# Project
#########

NAME	= calendar
NAMELIB = calendarLib
VERSION	= 2.0.2

LIBDIR	= target

LIBS	= $(LIBDIR)/$(NAMELIB).cmo
CLIBS   =
ifneq ($(CAMLOPT),no)
LIBS	:= $(LIBS) $(LIBDIR)/$(NAMELIB).cmx
CLIBS   := $(CLIBS) $(LIBDIR)/$(NAMELIB).o
endif

DIRS	= src

SRC	= utils.mli utils.ml time_Zone.mli time_Zone.ml period.mli \
	time_sig.mli time.mli time.ml ftime.mli ftime.ml \
	date_sig.mli date.mli date.ml \
	calendar_sig.mli calendar_builder.mli calendar_builder.ml \
	calendar.mli calendar.ml fcalendar.mli fcalendar.ml \
	printer.mli printer.ml \
	version.mli version.ml
SRC	:= $(addprefix src/, $(SRC))

ML	= $(filter %.ml, $(SRC))
MLI	= $(filter %.mli, $(SRC))

CMO	= $(ML:.ml=.cmo)
CMX	= $(CMO:.cmo=.cmx)
CMI	= $(MLI:.mli=.cmi)

GENERATED= src/version.ml

# Libs and flags
################

CAMLIBS	= -I $(DIRS)

CAMLFLAGS= $(CAMLIBS)
BYTEFLAGS= $(CAMLFLAGS)
OPTFLAGS = $(CAMLFLAGS) -noassert

# Main rules
############

all: $(LIBS) META

$(LIBS): $(LIBDIR)

$(LIBDIR)/$(NAMELIB).cmo: $(CMO)
	$(CAMLFIND) ocamlc $(BYTEFLAGS) -pack -o $@ \
		$(filter-out $(LIBDIR), $^)

$(LIBDIR)/$(NAMELIB).cma: $(CMO)
	$(CAMLFIND) ocamlc $(BYTEFLAGS) -a -o $@ $(filter-out $(LIBDIR), $^)

$(CMX):OPTFLAGS:=$(OPTFLAGS) -for-pack CalendarLib

$(LIBDIR)/$(NAMELIB).cmx: $(CMX)
	$(CAMLFIND) ocamlopt $(OPTFLAGS) -pack -o $@ \
		$(filter-out $(LIBDIR), $^)

$(LIBDIR)/$(NAMELIB).a $(LIBDIR)/$(NAMELIB).cmxa: $(CMX)
	$(CAMLFIND) ocamlopt $(OPTFLAGS) -a -o $@ $(filter-out $(LIBDIR), $^)

$(LIBDIR):
	mkdir -p $@

src/version.ml: Makefile
	echo "let version = \"$(VERSION)\"" > $@
	echo "let date = \"`date`\"" >> $@

META: Makefile
	echo "description = \"$(NAME) library\"" > $@
	echo "version = \"$(VERSION)\"" >> $@
	echo "archive(byte) = \"$(NAMELIB).cmo\"" >> $@
	echo "archive(native) = \"$(NAMELIB).cmx\"" >> $@
	echo "requires = \"unix str\"" >> $@

# Generic rules
###############

%.gz: %
	gzip -f --best $<

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

.mli.cmi:
	$(CAMLC) $(BYTEFLAGS) -c $<

.ml.cmo:
	$(CAMLC) $(BYTEFLAGS) -c $<

.ml.o:
	$(CAMLOPT) $(OPTFLAGS) -c $<

.ml.cmx:
	$(CAMLOPT) $(OPTFLAGS) -c $<

# Tests
#######

TESTS	= test_timezone test_time test_ftime test_date \
	test_calendar test_fcalendar test_pcalendar test_fpcalendar \
	test_printer
TESTS	:= $(addprefix tests/, $(TESTS))

TESTS_CMO= $(addsuffix .cmo, $(TESTS))

$(TESTS_CMO): tests/gen_test.cmo
tests/test.cmo: $(TESTS_CMO)

tests/test: $(LIBDIR)/$(NAMELIB).cmo tests/test.cmo
	$(CAMLC) -o $@ $(BYTEFLAGS) unix.cma str.cma $(LIBDIR)/$(NAMELIB).cmo \
		tests/gen_test.cmo $(TESTS_CMO) tests/test.cmo

$(TESTS_CMO) tests/test.cmo: BYTEFLAGS := -I tests -I target

.PHONY: tests
tests: tests/test
	./$<

# Documentation
###############

wc: $(SRC)
	$(CAMLWC) -p $^

$(NAMELIB).ps: $(SRC)
	$(CAMLWEB) --ps -o $@ $^

utils/example.cmo: utils/example.ml
	$(CAMLC) -I +ocamldoc -I utils -c $<

.PHONY: doc
doc: $(CMO) utils/example.cmo
	mkdir -p doc
	rm -f doc/*
	$(CAMLDOC) -g utils/example.cmo -colorize-code -I src -d doc \
		$(MLI) $(ML)

# Headers
#########

.PHONY: headers
headers:
	headache -c headache_config.txt -h HEADER $(SRC) Makefile.in 
	headache -c headache_config.txt -h CONFIGURE_HEADER configure.in

# Install
#########

install: $(LIBS) $(CLIBS) META
	@if [ "`sed -n -e 's/version = "\([0-9.]*\)"/\1/p' META`" = "$(VERSION)" ]; then \
	  (if test -d $(CAMLLIB)/site-lib/$(NAME); then $(MAKE) uninstall; fi;\
	  $(CAMLFIND) install $(NAME) target/*.cm[iox] $(MLI) $(CMI) $(CLIBS) META\
	)else \
	  (echo; echo "Not the good version. Please, do :"; \
	   echo "  make clean && make"; \
	   echo "next reinstall"; echo) \
	fi

uninstall:
	$(CAMLFIND) remove $(NAME)

# Exporting
###########

EXPORT_DIR= $$HOME/WWW/prog/$(NAME)
TMP_DIR	= tmp

export: doc #$(NAME).ps.gz
	cvs export -d $(TMP_DIR)/$(NAME)-$(VERSION) -D now $(NAME)
	rm -rf $(EXPORT_DIR)/doc
	cp -rf .depend configure config.status doc $(TMP_DIR)/$(NAME)-$(VERSION)
	cp -rf CHANGES doc $(EXPORT_DIR)
	chmod -R ugo+r $(TMP_DIR)/$(NAME)-$(VERSION)
	cd $(TMP_DIR); \
	  (rm -f $(NAME)-$(VERSION)/html/touch-html \
		$(NAME)-$(VERSION)/.cvsignore; \
	   tar cvf $(NAME)-$(VERSION).tar $(NAME)-$(VERSION); \
	   gzip -f --best $(NAME)-$(VERSION).tar; \
	   rm -rf $(NAME)-$(VERSION); \
	   mv $(NAME)-$(VERSION).tar.gz $(EXPORT_DIR))
# 	cd $(EXPORT_DIR)/../..; \
# 	  (sed -e "s/_CALVERS_/$(VERSION)/" misc/bindings.dat.pre \
# 	      > misc/bindings.dat; \
# 	   ./scripts/create_html.sh)

# Rebuilding Makefile
#####################

Makefile: Makefile.in
	./config.status			

config.status: configure
	./config.status --recheck

configure: configure.in
	autoconf

# Emacs tags
############

TAGS: $(SRC)
	otags -o $@ $^

# Cleaning
##########

clean:
	rm -f TAGS META $(TESTS) tests/test $(GENERATED) 
	for i in . src tests utils; do \
	  rm -f $$i/*~ $$i/\#* $$i/*.cm[iox] $$i/*.*a $$i/*.o $$i/a.out; \
	done

dist-clean distclean: clean
	rm -rf $(NAME).ps.gz doc $(LIBDIR)

clean-configure cleanconfig: dist-clean
	rm -f Makefile configure config.*

# Depend
########

.depend depend: $(GENERATED)
	rm -f .depend
	for i in src tests; do \
	  $(CAMLDEP) $(CAMLIBS) -I tests $$i/*.ml $$i/*.mli; \
	done > .depend

view-depend:
	$(CAMLDOT) .depend | dot -Tps | gv -

include .depend