Skip to content

Commit

Permalink
Merge pull request #1093 from tleedjarv/portable-make-3
Browse files Browse the repository at this point in the history
Portable makefiles 3
  • Loading branch information
gdt authored Dec 13, 2024
2 parents 46ad269 + 8cef740 commit 5b2d767
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Makefile.OCaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ ifeq ($(NATIVE), true)

CAMLC=$(OCAMLOPT)

CAMLOBJS=$(subst .cmo,.cmx, $(subst .cma,.cmxa, $(OCAMLOBJS)))
CAMLLIBS=$(subst .cma,.cmxa, $(OCAMLLIBS))
CAMLOBJS = $(OCAMLOBJS:.cmo=.cmx)
CAMLLIBS = $(OCAMLLIBS:.cma=.cmxa)

else
## Set up for bytecode compilation
Expand Down Expand Up @@ -422,23 +422,22 @@ win32rc/unison.res.lib: win32rc/unison.rc win32rc/U.ico
$(WINDRES) win32rc/unison.rc win32rc/unison.res
$(WINDRES) win32rc/unison.res win32rc/unison.res.lib

%.ml: %.mll
-$(RM) $@
ocamllex $<
.SUFFIXES:
.SUFFIXES: .mli .cmi .ml .cmo .cmx .c .o .obj

%.cmi : %.mli
.mli.cmi:
@echo "$(CAMLC): $< ---> $@"
$(CAMLC) $(CAMLFLAGS) -c $(CWD)/$<

%.cmo: %.ml
.ml.cmo:
@echo "$(OCAMLC): $< ---> $@"
$(OCAMLC) $(CAMLFLAGS) -c $(CWD)/$<

%.cmx: %.ml
.ml.cmx:
@echo "$(OCAMLOPT): $< ---> $@"
$(OCAMLOPT) $(CAMLFLAGS) -c $(CWD)/$<

%$(OBJ_EXT): %.c
.c$(OBJ_EXT):
@echo "$(CAMLC): $< ---> $@"
$(CAMLC) $(CAMLFLAGS) $(CAMLCFLAGS) -ccopt $(OUTPUT_SEL)$(CWD)/$@ -c $(CWD)/$<

Expand Down

0 comments on commit 5b2d767

Please sign in to comment.