]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/netstring/Makefile
Initial revision
[helm.git] / helm / DEVEL / pxp / netstring / Makefile
1 # make all:             make bytecode archive
2 # make opt:             make native archive
3 # make install:         install bytecode archive, and if present, native archive
4 # make uninstall:       uninstall package
5 # make clean:           remove intermediate files
6 # make distclean:       remove any superflous files
7 # make release:         cleanup, create archive, tag CVS module 
8 #                       (for developers)
9
10 #----------------------------------------------------------------------
11 # specific rules for this package:
12
13 OBJECTS  = netstring_str.cmo \
14            netencoding.cmo netbuffer.cmo netstream.cmo \
15            mimestring.cmo cgi.cmo base64.cmo \
16            nethtml_scanner.cmo nethtml.cmo \
17            neturl.cmo \
18            netmappings.cmo netconversion.cmo
19 XOBJECTS = $(OBJECTS:.cmo=.cmx)
20 ARCHIVE  = netstring.cma
21 XARCHIVE = netstring.cmxa
22
23 NAME     = netstring
24 REQUIRES = str
25
26 ISO_MAPPINGS   = mappings/iso*.unimap
27 OTHER_MAPPINGS = mappings/cp*.unimap \
28                  mappings/adobe*.unimap \
29                  mappings/jis*.unimap \
30                  mappings/koi*.unimap \
31                  mappings/mac*.unimap \
32                  mappings/windows*.unimap
33
34 all: $(ARCHIVE) \
35      netstring_top.cmo netstring_mt.cmo \
36      netmappings_iso.cmo netmappings_other.cmo
37
38 opt: $(XARCHIVE) \
39      netstring_mt.cmx \
40      netmappings_iso.cmx netmappings_other.cmx
41
42
43 $(ARCHIVE): $(OBJECTS) 
44         $(OCAMLC) -a -o $(ARCHIVE) $(OBJECTS)
45
46 $(XARCHIVE): $(XOBJECTS) 
47         $(OCAMLOPT) -a -o $(XARCHIVE) $(XOBJECTS)
48
49 netmappings_iso.ml:
50         $(MAKE) -C tools 
51         test ! -d mappings || tools/unimap_to_ocaml/unimap_to_ocaml \
52                 -o netmappings_iso.ml $(ISO_MAPPINGS)
53
54 netmappings_other.ml:
55         $(MAKE) -C tools 
56         test ! -d mappings || tools/unimap_to_ocaml/unimap_to_ocaml \
57                 -o netmappings_other.ml $(OTHER_MAPPINGS)
58
59 #----------------------------------------------------------------------
60 # general rules:
61
62 OPTIONS   =
63 OCAMLC    = ocamlc $(DEBUG) $(OPTIONS) $(ROPTIONS)
64 OCAMLOPT  = ocamlopt $(OPTIONS) $(ROPTIONS)
65 OCAMLLEX  = ocamllex
66 OCAMLDEP  = ocamldep $(OPTIONS)
67 OCAMLFIND = ocamlfind
68
69 DEBUG  =
70 # Invoke with: make DEBUG=-g
71
72 depend: *.ml *.mli
73         $(OCAMLDEP) *.ml *.mli >depend
74
75 depend.pkg: Makefile
76         $(OCAMLFIND) use -p ROPTIONS= $(REQUIRES) >depend.pkg
77
78 .PHONY: install
79 install: all
80         { test ! -f $(XARCHIVE) || extra="*.cmxa *.a netstring_mt.cmx netmappings_iso.cmx netmappings_other.cmx netstring_mt.o netmappings_iso.o netmappings_other.o"; }; \
81         $(OCAMLFIND) install $(NAME) *.mli *.cmi *.cma netstring_top.cmo netstring_mt.cmo netmappings_iso.cmo netmappings_other.cmo META $$extra
82
83 .PHONY: install-cgi
84 install-cgi: 
85         $(OCAMLFIND) install cgi compat-cgi/META
86
87
88 .PHONY: install-base64
89 install-base64: 
90         $(OCAMLFIND) install base64 compat-base64/META
91
92
93 .PHONY: uninstall
94 uninstall:
95         $(OCAMLFIND) remove $(NAME)
96
97 .PHONY: uninstall-cgi
98 uninstall-cgi:
99         $(OCAMLFIND) remove cgi
100
101 .PHONY: uninstall-base64
102 uninstall-base64:
103         $(OCAMLFIND) remove base64
104
105 .PHONY: clean
106 clean:
107         rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa
108         test ! -d mappings || rm -f netmappings_iso.ml netmappings_other.ml
109
110 .PHONY: distclean
111 distclean:
112         rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa
113         rm -f *~ depend depend.pkg compat-cgi/*~ compat-base64/*~
114         $(MAKE) -C tests distclean
115         $(MAKE) -C doc distclean
116         $(MAKE) -C tools distclean
117
118 RELEASE: META
119         awk '/version/ { print substr($$3,2,length($$3)-2) }' META >RELEASE
120
121 .PHONY: dist
122 dist: RELEASE
123         r=`head -1 RELEASE`; cd ..; gtar czf $(NAME)-$$r.tar.gz --exclude='*/CVS*' --exclude="*/depend.pkg" --exclude="*/depend" --exclude="*/doc/common.xml" --exclude="*/doc/config.xml" --exclude="*/doc/readme.dtd" --exclude="*/Mail" --exclude="*/mappings" $(NAME)
124
125 .PHONY: tag-release
126 tag-release: RELEASE
127         r=`head -1 RELEASE | sed -e s/\\\./-/g`; cd ..; cvs tag -F $(NAME)-$$r $(NAME)
128
129 .PHONY: release
130 release: distclean
131         test -f netmappings_iso.ml
132         test -f netmappings_other.ml
133         $(MAKE) tag-release
134         $(MAKE) dist
135
136 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll
137
138 .ml.cmx:
139         $(OCAMLOPT) -c -thread $<
140
141 .ml.cmo:
142         $(OCAMLC) -c -thread $<
143
144 .mli.cmi:
145         $(OCAMLC) -c $<
146
147 .mll.ml:
148         $(OCAMLLEX) $<
149
150 include depend
151 include depend.pkg