~ubuntu-branches/ubuntu/vivid/sexplib310/vivid

« back to all changes in this revision

Viewing changes to OCamlMakefile

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Le Gall
  • Date: 2009-07-10 22:05:54 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090710220554-1uo37a033mcs674z
Tags: 4.2.11-2
* Generate ocamldoc documentation
* Use topgit "build" branch which contains missing patches of the former 
  upload
* Set debian-branch to build in gbp.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
###########################################################################
2
2
#                              OCamlMakefile
3
 
#                  Copyright (C) 1999-2007  Markus Mottl
 
3
#                  Copyright (C) 1999-  Markus Mottl
4
4
#
5
5
#                             For updates see:
6
6
#                http://www.ocaml.info/home/ocaml_sources.html
112
112
 
113
113
####################  variables depending on your OCaml-installation
114
114
 
 
115
SYSTEM := $(shell ocamlc -config 2>/dev/null | grep system | sed 's/system: //')
 
116
    # This may be
 
117
    # - mingw
 
118
    # - win32
 
119
    # - cygwin
 
120
    # - some other string means Unix
 
121
    # - empty means ocamlc does not support -config
 
122
 
 
123
ifeq ($(SYSTEM),mingw)
 
124
  MINGW=1
 
125
endif
 
126
ifeq ($(SYSTEM),win32)
 
127
  MSVC=1
 
128
endif
 
129
 
115
130
ifdef MINGW
116
131
  export MINGW
117
 
  WIN32   := 1
 
132
  WIN32 := 1
 
133
  # We are compiling with cygwin tools:
118
134
  CFLAGS_WIN32 := -mno-cygwin
 
135
  # The default value 'cc' makes 'ocamlc -cc "cc"' raises the error 'The
 
136
  # NTVDM CPU has encountered an illegal instruction'.
 
137
  CC := gcc
 
138
  # The OCaml C header files use this flag:
 
139
  CFLAGS += -D__MINGW32__
119
140
endif
120
141
ifdef MSVC
121
142
  export MSVC
481
502
endif
482
503
 
483
504
ifdef WIN32
484
 
DLLSONAME := $(CLIB_BASE).dll
 
505
DLLSONAME := dll$(CLIB_BASE).dll
485
506
else
486
507
DLLSONAME := dll$(CLIB_BASE).so
487
508
endif
489
510
NONEXECS     := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \
490
511
                $(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \
491
512
                $(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmo \
492
 
                $(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).o \
 
513
                $(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).$(EXT_OBJ) \
493
514
                $(RES_CLIB) $(IMPL_CMO:.cmo=.annot) \
494
 
                $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx $(LIB_PACK_NAME).o
 
515
                $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx \
 
516
                $(LIB_PACK_NAME).$(EXT_OBJ)
495
517
 
496
518
ifndef STATIC
497
519
  NONEXECS += $(DLLSONAME)
589
611
endif
590
612
 
591
613
ifdef LIB_PACK_NAME
592
 
  FOR_PACK_NAME := $(shell echo $(LIB_PACK_NAME) | sed -e 's/^\(.\)/\U\1/')
 
614
  FOR_PACK_NAME := $(shell echo $(LIB_PACK_NAME) | awk '{print toupper(substr($$0,1,1))substr($$0,2)}')
593
615
endif
594
616
 
595
617
# If we have to make byte-code
890
912
# packs native-code objects
891
913
pack-native-code:               $(PRE_TARGETS)
892
914
                        $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
893
 
                                $(NCRESULT).cmx $(NCRESULT).o \
 
915
                                $(NCRESULT).cmx $(NCRESULT).$(EXT_OBJ) \
894
916
                                REAL_RESULT="$(NCRESULT)" \
895
917
                                REAL_OCAMLC="$(OCAMLOPT)" \
896
918
                                PACK_LIB=yes make_deps=yes
940
962
 
941
963
ifndef STATIC
942
964
ifdef MINGW
 
965
# From OCaml 3.11.0, ocamlmklib is available on windows
 
966
OCAMLMLIB_EXISTS = $(shell which $(OCAMLMKLIB))
 
967
ifeq ($(strip $(OCAMLMLIB_EXISTS)),)
943
968
$(DLLSONAME):           $(OBJ_LINK)
944
969
                        $(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
945
 
                        -Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
946
 
                         $(OCAMLLIBPATH)/ocamlrun.a \
 
970
                        $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
 
971
                         '$(OCAMLLIBPATH)/ocamlrun.a' \
 
972
                        -Wl,--whole-archive \
947
973
                        -Wl,--export-all-symbols \
948
 
                        -Wl,--no-whole-archive
 
974
                        -Wl,--allow-multiple-definition \
 
975
                        -Wl,--enable-auto-import
 
976
else
 
977
$(DLLSONAME):           $(OBJ_LINK)
 
978
                        $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \
 
979
                                -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \
 
980
                                $(CFRAMEWORKS:%=-framework %) \
 
981
                                $(OCAMLMKLIB_FLAGS)
 
982
endif
949
983
else
950
984
ifdef MSVC
951
985
$(DLLSONAME):           $(OBJ_LINK)
952
986
                        link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
953
987
                         $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
954
 
                         $(OCAMLLIBPATH)/ocamlrun.lib
 
988
                         '$(OCAMLLIBPATH)/ocamlrun.lib'
955
989
 
956
990
else
957
991
$(DLLSONAME):           $(OBJ_LINK)