ocaml/otherlibs/win32unix/Makefile.nt

86 lines
2.0 KiB
Makefile

!include ../../config/Makefile.nt
# Compilation options
SYSTEM_INCLUDES=\msdev\include
CC=$(BYTECC)
CFLAGS=-I..\..\byterun -I..\unix $(BYTECCCOMPOPTS)
CAMLC=..\..\boot\ocamlrun ..\..\boot\ocamlc -I ..\..\stdlib
CAMLOPT=..\..\boot\ocamlrun ..\..\ocamlopt -I ..\..\stdlib
# Files in this directory
WIN_OBJS = accept.obj bind.obj close_on.obj connect.obj \
createprocess.obj getpeername.obj getpid.obj \
getsockname.obj listen.obj mkdir.obj open.obj pipe.obj sendrecv.obj \
shutdown.obj sleep.obj socket.obj sockopt.obj startup.obj system.obj \
unixsupport.obj windir.obj winwait.obj
# Files from the ..\unix directory
UNIX_FILES = access.c addrofstr.c chdir.c close.c cst2constr.c \
cstringv.c dup.c dup2.c envir.c errmsg.c execv.c execve.c execvp.c \
exit.c getcwd.c gethost.c gethostname.c getproto.c \
getserv.c gmtime.c lseek.c read.c rename.c rmdir.c \
socketaddr.c stat.c strofaddr.c time.c unlink.c utimes.c write.c
UNIX_OBJS = $(UNIX_FILES:.c=.obj)
C_OBJS=$(WIN_OBJS) $(UNIX_OBJS)
CAML_OBJS=unix.cmo
CAMLOPT_OBJS=unix.cmx
all: libunix.lib unix.cma
allopt: libunix.lib unix.cmxa
libunix.lib: copy_unix_files io.h $(C_OBJS)
rm -f libthreads.lib
$(MKLIB)libunix.lib $(C_OBJS)
copy_unix_files:
@- cd ..\unix & cp -p -u -v $(UNIX_FILES) ../win32unix
# This requires GNU cp
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)
unix.cmxa: $(CAMLOPT_OBJS)
$(CAMLOPT) -a -linkall -o unix.cmxa $(CAMLOPT_OBJS)
partialclean:
rm -f *.cm*
clean: partialclean
rm -f *.lib *.obj
rm -f $(UNIX_FILES)
rm -f io.h
install:
cp libunix.lib $(LIBDIR)/libunix.lib
cp unix.cmi unix.cma $(LIBDIR)
installopt:
cp unix.cmxa unix.cmx unix.lib $(LIBDIR)
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.mli.cmi:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
$(CAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
$(CAMLOPT) -c $(COMPFLAGS) $<
depend:
gcc -MM -I../../byterun *.c > .depend
..\..\boot\ocamlrun ../../tools/ocamldep *.mli *.ml >> .depend
unix.cmi: unix.mli
unix.cmo: unix.cmi
!include .depend