Permalink
Browse files

Adds OBJEXT, LIBEXT and EXEEXT configuration variables (Thanks to Tho…

…mas Ripoche)

It allows the compilation on win32/msvc.
  • Loading branch information...
1 parent e49db91 commit 0f4db335565eb1ba0600466d7d9d96e5ca0bed44 @hnrgrgr hnrgrgr committed Nov 23, 2011
Showing with 16 additions and 11 deletions.
  1. +5 −0 Makefile.config
  2. +1 −1 Makefile.filelist
  3. +1 −1 lib/Makefile
  4. +6 −6 syntax/Makefile
  5. +3 −3 tests/Makefile
View
@@ -3,3 +3,8 @@ PROJECTNAME := deriving-ocsigen
OCAMLFIND := ocamlfind
TYPECONV := $(shell ${OCAMLFIND} query type-conv 2>/dev/null)
+
+OBJEXT := .o
+LIBEXT := .a
+EXEEXT :=
+
View
@@ -20,7 +20,7 @@ NATIMPL := syntax/pa_deriving_common.cmx \
syntax/pa_deriving.cmx \
syntax/pa_deriving.cmxa \
lib/deriving.cmxa \
- lib/deriving.a \
+ lib/deriving$(LIBEXT) \
ifneq (${TYPECONV},)
View
@@ -44,7 +44,7 @@ deriving.cmxa: ${SOURCES:.ml=.cmx}
# Clean up
clean:
- -rm -f *.cm[ioax] *.cmxa *.cmxs *.o *.a *.annot
+ -rm -f *.cm[ioax] *.cmxa *.cmxs *${OBJEXT} *${LIBEXT} *.annot
distclean: clean
-rm -f *~ \#* .\#*
View
@@ -57,8 +57,8 @@ PREDEP := id.ml
all: byte opt
-byte:: pa_deriving.cma deriving
-opt:: pa_deriving.cmxa deriving.opt
+byte:: pa_deriving.cma deriving${EXEEXT}
+opt:: pa_deriving.cmxa deriving.opt${EXEEXT}
ifneq (${TYPECONV},)
byte:: pa_deriving_tc.cma
@@ -90,11 +90,11 @@ ${SOURCES:.ml=.cmx}: FOR_PACK=-for-pack Pa_deriving_common
##
-deriving: pa_deriving.cma
+deriving${EXEEXT}: pa_deriving.cma
${OCAMLC} -linkpkg -o $@ \
${DERIVING_LIBS} ${CAMLP4_PREFILES} $^ ${CAMLP4_POSTFILES}
-deriving.opt: pa_deriving.cmxa
+deriving.opt${EXEEXT}: pa_deriving.cmxa
${OCAMLOPT} -linkpkg -o $@ \
${DERIVING_LIBS} ${CAMLP4_PREFILES:.cmo=.cmx} $^ ${CAMLP4_POSTFILES:.cmo=.cmx}
@@ -119,8 +119,8 @@ id.ml: id.mlp ../Makefile.config ../VERSION
# Clean up
clean:
- -rm -f *.cm[ioax] *.cmxa *.cmxs *.o *.a *.annot
- -rm -f deriving deriving.opt
+ -rm -f *.cm[ioax] *.cmxa *.cmxs *${OBJEXT} *${LIBEXT} *.annot
+ -rm -f deriving${EXEEXT} deriving.opt${EXEEXT}
distclean: clean
-rm -f .*.deps classes/.*.deps
-rm -f *~ \#* .\#*
View
@@ -24,7 +24,7 @@ SOURCES = defs.ml \
##
-tests: ${SOURCES:.ml=.cmo}
+tests${EXEEXT}: ${SOURCES:.ml=.cmo}
${OCAMLC} -o $@ ${LIBS} -linkpkg deriving.cma $^
# Common rules
@@ -38,8 +38,8 @@ tests: ${SOURCES:.ml=.cmo}
# Clean up
clean:
- -rm -f *.cm[ioax] *.cmxa *.cmxs *.o *.a *.annot
- -rm -f tests
+ -rm -f *.cm[ioax] *.cmxa *.cmxs *${OBJEXT} *${LIBEXT} *.annot
+ -rm -f tests${EXEEXT}
distclean: clean
-rm -f *~ \#* .\#*

0 comments on commit 0f4db33

Please sign in to comment.