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
|
# Calendar library
# Copyright (C) 2003 Julien SIGNOLES
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License version 2, as published by the Free Sofware Foundation.
#
# This library 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 version 2 for more details
#
# $Id: Makefile.in,v 1.48 2005/01/17 13:27:36 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
VERSION = 1.09.3
ifeq ($(CAMLOPT),no)
LIBS = src/$(NAME).cma
CLIBS =
else
LIBS = src/$(NAME).cma src/$(NAME).cmxa
CLIBS = src/$(NAME).a
endif
DIRS = src
SRC = time_Zone.mli time_Zone.ml period.mli \
time.mli time.ml date.mli date.ml calendar.mli calendar.ml \
printer.mli printer.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=
# Libs and flags
################
CAMLIBS = -I $(DIRS)
CAMLFLAGS= $(CAMLIBS)
BYTEFLAGS= $(CAMLFLAGS)
OPTFLAGS = $(CAMLFLAGS) -noassert
# Main rules
############
all: $(LIBS) META
src/$(NAME).cma: $(CMO)
$(CAMLFIND) ocamlc $(BYTEFLAGS) -a -o $@ $^
src/$(NAME).a src/$(NAME).cmxa: $(CMX)
$(CAMLFIND) ocamlopt $(OPTFLAGS) -a -o $@ $^
META: Makefile
echo "description = \"$(NAME) library\"" > $@
echo "version = \"$(VERSION)\"" >> $@
echo "archive(byte) = \"$(NAME).cma\"" >> $@
echo "archive(native) = \"$(NAME).cmxa\"" >> $@
echo "requires = \"unix\"" >> $@
# 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_date test_calendar test_printer
TESTS := $(addprefix tests/, $(TESTS))
TESTS_CMO= $(addsuffix .cmo, $(TESTS))
$(TESTS_CMO): tests/gen_test.cmo
tests/test.cmo: $(TESTS_CMO)
tests/test: src/$(NAME).cma tests/test.cmo
$(CAMLC) -o $@ $(BYTEFLAGS) unix.cma src/$(NAME).cma \
tests/gen_test.cmo $(TESTS_CMO) tests/test.cmo
.PHONY: tests
tests: BYTEFLAGS := $(BYTEFLAGS) -I tests
tests: tests/test
./$<
# Documentation
###############
wc: $(SRC)
$(CAMLWC) -p $^
$(NAME).ps: $(SRC)
$(CAMLWEB) --ps -o $@ $^
.PHONY: doc
doc: $(CMO)
mkdir -p doc
rm -f doc/*
$(CAMLDOC) -I src -d doc -html $(MLI) $(ML)
# 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) $(LIBS) $(CLIBS) $(MLI) $(CMI) 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/calendar
export: doc #$(NAME).ps.gz
cvs export -d /tmp/$(NAME)-$(VERSION) -D now $(NAME)
rm -rf $(EXPORT_DIR)/doc
cp -rf .depend configure doc /tmp/$(NAME)-$(VERSION)
cp -rf CHANGES doc $(EXPORT_DIR)
cd /tmp; \
(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)/../..; \
(rm -f calendar.*.tex; \
$(MAKE) CALVERS=$(VERSION))
# Rebuilding Makefile
#####################
Makefile: Makefile.in config.status
./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; 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
clean-configure cleanconfig: dist-clean
rm -f Makefile configure config.*
# Depend
########
depend:
rm -f .depend
for i in src tests; do \
$(CAMLDEP) $(CAMLIBS) $$i/*.ml $$i/*.mli; \
done > .depend
view-depend:
$(CAMLDOT) .depend | dot -Tps | gv -
include .depend
|