Skip to content

Commit

Permalink
BIN: build and install joo_minify
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Oct 31, 2013
1 parent b4f308b commit 8c3d7b7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ toplevel/toplevel.js
examples/wiki/wikicreole.ml
examples/*/*.js
compiler/js_of_ocaml
compiler/joo_minify
compiler/js_lexer.ml
compiler/js_lexer.mli
compiler/js_parser.ml
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ uninstall:
ocamlfind remove $(LIBRARY)
ocamlfind remove $(COMPILER_LIBRARY)
rm -f $(BINDIR)/$(COMPILER)
rm -f $(BINDIR)/$(MINIFIER)

reinstall: uninstall install

Expand Down
2 changes: 1 addition & 1 deletion Makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LIBRARY := js_of_ocaml
LIBNAME := js_of_ocaml$(LIBEXT)
COMPILER := js_of_ocaml$(EXEEXT)
COMPILER_LIBRARY := js_of_ocaml_compiler

MINIFIER := joo_minify$(EXEEXT)
# opt/byte
BEST := opt

Expand Down
2 changes: 1 addition & 1 deletion Makefile.filelist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BIN := compiler/${COMPILER}
BIN := compiler/${COMPILER} compiler/${MINIFIER}

INTF := lib/*.cmi

Expand Down
17 changes: 11 additions & 6 deletions compiler/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

include ../Makefile.conf

all: $(COMPILER)
all: $(COMPILER) $(MINIFIER)

lib: compiler.cma compiler.cmxa compiler.cmxs

Expand All @@ -22,17 +22,22 @@ COMPOBJS=$(OBJS) compile.cmx
$(COMPILER): compile.$(BEST)
mv -f $< $@

.INTERMEDIATE: compile.byte compile.opt
$(MINIFIER): minify.$(BEST)
mv -f $< $@

.INTERMEDIATE: compile.byte compile.opt minify.byte minify.opt

compile.byte: $(COMPOBJS:cmx=cmo)
ocamlfind ocamlc -package $(PACKAGES) -linkpkg -o $@ $^
compile.opt: $(COMPOBJS)
ocamlfind ocamlopt -package $(PACKAGES) -linkpkg -o $@ $^

minify.byte: $(OBJS:cmx=cmo) minify.cmo
ocamlfind ocamlc -package $(PACKAGES) -linkpkg -o $@ $^


compile.opt: $(COMPOBJS)
minify.opt: $(OBJS:cmx=cmx) minify.cmx
ocamlfind ocamlopt -package $(PACKAGES) -linkpkg -o $@ $^


compiler.cma: $(OBJS:cmx=cmo)
ocamlfind ocamlc -pack -o $@ $^

Expand Down Expand Up @@ -63,7 +68,7 @@ compiler.cmxs: $(OBJS)
ocamllex $<
clean:
rm -f *.cm[aiox] *.cmxa *.cmxs *.o *.a
rm -f js_of_ocaml compile.opt compile.byte
rm -f js_of_ocaml compile.opt compile.byte minify.opt minify.byte

depend:
${MAKE} --no-print-directory js_lexer.ml
Expand Down

0 comments on commit 8c3d7b7

Please sign in to comment.