Skip to content

Commit a313b21

Browse files
authored
builds and installs cmxs (#13)
also adds the META file. Fixes #12
1 parent 4b25892 commit a313b21

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ calipso/calipso
1919
calipso/calipso_stat
2020
ctoxml/ctoxml
2121
printc/printc
22+
*.cmxs

META

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description = "Parser for the C language"
2+
version = "3.4.3"
3+
requires = "unix"
4+
archive(byte) = "frontc.cma"
5+
archive(native) = "frontc.cmxa"
6+
plugin(byte) = "frontc.cma"
7+
plugin(native) = "frontc.cmxs"

Makefile.head

+17-10
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ endef
6262
# Library compilation
6363
define ocaml_byte_code_lib
6464

65-
_ALL += $(1).cma
65+
_ALL += $(1).cma
6666
$(1)_MLO = $(call ocaml_sources,$(2))
6767
$(1)_CMO = $$(patsubst %.ml,%.cmo,$$($(1)_MLO))
6868
$(1)_MLLO = $$(filter %.mll,$(2))
@@ -84,14 +84,14 @@ $(1).cma: $$($(1)_CMO)
8484
$$(OCAMLC) -a $$($(1)_LDFLAGS) $$(OCAMLC_LDFLAGS) -o $$@ $$($(1)_CMO) $$(OCAMLC_LIBS)
8585

8686
_install_$(1)_CMA:
87-
install -d $(OCAML_SITE)/$(1)
88-
install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/$(1)
89-
87+
install -d $(OCAML_SITE)/FrontC
88+
install $(1).cma $$($(1)_CMIO) $(OCAML_SITE)/FrontC
89+
9090
endef
9191

9292
define ocaml_native_lib
9393

94-
_ALL += $(1).cmxa
94+
_ALL += $(1).cmxa $(1).cmxs
9595
$(1)_MLX = $(call ocaml_sources,$(2))
9696
$(1)_CMX = $$(patsubst %.ml,%.cmx,$$($(1)_MLX))
9797
$(1)_MLLX = $$(filter %.mll,$(2))
@@ -107,16 +107,23 @@ _CLEAN += $$($(1)_CMX) \
107107
$$(patsubst %.mly,%.ml,$$($(1)_MLYX)) \
108108
$$(patsubst %.mly,%.mli,$$($(1)_MLYX))
109109
_DIST += $(2)
110-
_BINARY_DIST += $(1).cmxa $(1).a $(patsubst %.cmx,%.cmi,$$($(1)_CMX))
111-
_INSTALL += _install_$(1)_CMXA
110+
_BINARY_DIST += $(1).cmxa $(1).cmxs $(1).a $(patsubst %.cmx,%.cmi,$$($(1)_CMX))
111+
_INSTALL += _install_$(1)_CMXA _install_$(1)_CMXS
112112

113113
$(1).cmxa: $$($(1)_CMX)
114114
$$(OCAMLOPT) -a $$($(1)_LDFLAGS) $$(OCAMLOPT_LDFLAGS) -o $$@ $$($(1)_CMX) $$(OCAMLOPT_LIBS)
115115

116+
$(1).cmxs: $$($(1).cmxa)
117+
$$(OCAMLOPT) -shared -linkall $$($(1).cmxa) -o $$@
118+
116119
_install_$(1)_CMXA:
117-
install -d $(OCAML_SITE)/$(1)
118-
install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/$(1)
119-
120+
install -d $(OCAML_SITE)/FrontC
121+
install $(1).cmxa $(1).a $$($(1)_CMIX) $(OCAML_SITE)/FrontC
122+
123+
_install_$(1)_CMXS:
124+
install -d $(OCAML_SITE)/FrontC
125+
install $(1).cmxs $(OCAML_SITE)/FrontC
126+
120127
endef
121128

122129
define ocaml_lib

0 commit comments

Comments
 (0)