116 lines
3.4 KiB
Makefile
116 lines
3.4 KiB
Makefile
#########################################################################
|
|
# #
|
|
# Objective Caml #
|
|
# #
|
|
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
|
|
# #
|
|
# Copyright 1999 Institut National de Recherche en Informatique et #
|
|
# en Automatique. All rights reserved. This file is distributed #
|
|
# under the terms of the GNU Library General Public License. #
|
|
# #
|
|
#########################################################################
|
|
|
|
# $Id$
|
|
|
|
!include ../../config/Makefile.nt
|
|
|
|
# Compilation options
|
|
CC=$(BYTECC)
|
|
CFLAGS=-I..\..\byterun -I..\unix
|
|
CAMLC=..\..\boot\ocamlrun ..\..\ocamlc -I ..\..\stdlib
|
|
CAMLOPT=..\..\boot\ocamlrun ..\..\ocamlopt -I ..\..\stdlib
|
|
|
|
# Files in this directory
|
|
WIN_OBJS = accept.obj bind.obj channels.obj close.obj \
|
|
close_on.obj connect.obj createprocess.obj dup.obj dup2.obj errmsg.obj \
|
|
getpeername.obj getpid.obj getsockname.obj gettimeofday.obj \
|
|
link.obj listen.obj lseek.obj \
|
|
mkdir.obj open.obj pipe.obj read.obj select.obj sendrecv.obj \
|
|
shutdown.obj sleep.obj socket.obj sockopt.obj startup.obj system.obj \
|
|
unixsupport.obj windir.obj winwait.obj write.obj
|
|
|
|
# Files from the ..\unix directory
|
|
UNIX_FILES = access.c addrofstr.c chdir.c chmod.c cst2constr.c \
|
|
cstringv.c envir.c execv.c execve.c execvp.c \
|
|
exit.c getcwd.c gethost.c gethostname.c getproto.c \
|
|
getserv.c gmtime.c putenv.c rename.c rmdir.c \
|
|
socketaddr.c stat.c strofaddr.c time.c unlink.c utimes.c
|
|
|
|
UNIX_OBJS = $(UNIX_FILES:.c=.obj)
|
|
|
|
C_OBJS=$(WIN_OBJS) $(UNIX_OBJS)
|
|
|
|
CAML_OBJS=unix.cmo unixLabels.cmo
|
|
CAMLOPT_OBJS=$(CAML_OBJS:.cmo=.cmx)
|
|
|
|
all: libunix.dll libunix.lib unix.cma
|
|
|
|
allopt: libunix.lib unix.cmxa
|
|
|
|
libunix.dll: copy_unix_files io.h $(C_OBJS:.obj=.dobj)
|
|
link /nologo /dll /out:libunix.dll /implib:tmp.lib \
|
|
$(C_OBJS:.obj=.dobj) ..\..\byterun\ocamlrun.lib wsock32.lib
|
|
rm tmp.*
|
|
|
|
libunix.lib: copy_unix_files io.h $(C_OBJS:.obj=.sobj)
|
|
rm -f libunix.lib
|
|
$(MKLIB)libunix.lib $(C_OBJS:.obj=.sobj)
|
|
|
|
copy_unix_files:
|
|
@- cd ..\unix & cp -p -u -v $(UNIX_FILES) ../win32unix
|
|
# This requires GNU cp
|
|
@cp ../unix/unix.mli ../unix/unixLabels.ml* .
|
|
|
|
io.h: "$(SYSTEM_INCLUDES)\io.h"
|
|
copy "$(SYSTEM_INCLUDES)\io.h" io.h
|
|
|
|
unix.cma: $(CAML_OBJS)
|
|
$(CAMLC) -a -linkall -o unix.cma $(CAML_OBJS) \
|
|
-cclib -lunix
|
|
|
|
unix.cmxa: $(CAMLOPT_OBJS)
|
|
$(CAMLOPT) -a -linkall -o unix.cmxa $(CAMLOPT_OBJS) \
|
|
-cclib -lunix wsock32.lib
|
|
|
|
partialclean:
|
|
rm -f *.cm*
|
|
|
|
clean: partialclean
|
|
rm -f *.lib *.dll *.exp *.sobj *.dobj
|
|
rm -f $(UNIX_FILES)
|
|
rm -f io.h
|
|
|
|
install:
|
|
cp libunix.dll $(LIBDIR)/libunix.dll
|
|
cp libunix.lib $(LIBDIR)/libunix.lib
|
|
cp unix.cmi unix.cma $(LIBDIR)
|
|
|
|
installopt:
|
|
cp unix.cmxa unix.cmx unix.lib $(LIBDIR)
|
|
|
|
unixLabels.cmo: unixLabels.ml
|
|
$(CAMLC) -c $(COMPFLAGS) -nolabels unixLabels.ml
|
|
|
|
.SUFFIXES: .ml .mli .cmo .cmi .cmx .dobj .sobj
|
|
|
|
.mli.cmi:
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
.ml.cmo:
|
|
$(CAMLC) -c $(COMPFLAGS) $<
|
|
|
|
.ml.cmx:
|
|
$(CAMLOPT) -c $(COMPFLAGS) $<
|
|
|
|
.c.dobj:
|
|
$(BYTECC) $(DLLCCCOMPOPTS) $(CFLAGS) -c $<
|
|
mv $*.obj $*.dobj
|
|
|
|
.c.sobj:
|
|
$(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c $<
|
|
mv $*.obj $*.sobj
|
|
|
|
depend:
|
|
|
|
!include .depend
|