-# $Id: Makefile,v 1.2 1996/11/21 16:47:46 simonm Exp $
-
-TOP = ../../..
-UnlitSuffixRules = YES
-include $(TOP)/ghc/mk/ghc.mk
-
-ARCHIVE=libHS_cbits.a
-DESTDIR=$(INSTLIBDIR_GHC)
-
-SRCS=\
-closeFile.lc createDirectory.lc \
-errno.lc fileEOF.lc \
-fileGetc.lc fileLookAhead.lc \
-filePosn.lc filePutc.lc \
-fileSize.lc flushFile.lc \
-getBufferMode.lc getCurrentDirectory.lc \
-getDirectoryContents.lc getLock.lc \
-inputReady.lc openFile.lc \
-readFile.lc removeDirectory.lc \
-removeFile.lc renameDirectory.lc \
-renameFile.lc seekFile.lc \
-setBuffering.lc setCurrentDirectory.lc \
-system.lc writeFile.lc
-
-LIBOBJS = $(patsubst %.lc, %.o, $(SRCS))
-
-%.o : %.c
- @$(RM) $@
- $(GHC) $(GHCFLAGS) -c $< -o $@
-
-clean ::
- $(RM) $(SRCS:.lc=.c)
-
-C_DEP_SRCS = $(SRCS)
-MKDEPENDC_OPTS = -I$(GHC_INCLUDES)
-
-include $(TOP)/mk/lib.mk
+# $Id: Makefile,v 1.3 1997/03/14 05:17:06 sof Exp $
+
+TOP = ../..
+include $(TOP)/mk/boilerplate.mk
+WAYS=
+
+LIBRARY=libHS_cbits.a
+INSTALL_LIBS+=$(LIBRARY)
+
+SRCS= $(wildcard *.lc)
+
+C_SRCS = $(SRCS:.lc=.c)
+C_OBJS = $(C_SRCS:.c=.o)
+LIBOBJS = $(C_OBJS)
+SRC_CC_OPTS = -I$(GHC_INCLUDE_DIR)
+
+#
+# Compile the files using the Haskell compiler (ghc really).
+#
+CC=$(HC)
+
+#
+# Remove the intermediate .c files
+# (the .o's will be removed automatically by default mk setup)
+#
+CLEAN_FILES += $(C_SRCS)
+
+SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
+
+include $(TOP)/mk/target.mk
#ifndef STGIO_H
#define STGIO_H
-/* Decls for routines in ghc/runtime/io/ only used there.
+/* Decls for routines in ghc/lib/cbits/ only used there.
* This file is used when compiling the Haskell library
* that _ccalls_ those routines; and when compiling those
* routines (to check consistency).
*/
/* closeFile.lc */
-StgInt closeFile PROTO((StgAddr));
+StgInt closeFile PROTO((StgForeignObj));
/* createDirectory.lc */
StgInt createDirectory PROTO((StgByteArray));
int execvpe PROTO((char *, char **, char **));
/* fileEOF.lc */
-StgInt fileEOF PROTO((StgAddr));
-
+StgInt fileEOF PROTO((StgForeignObj));
/* fileGetc.lc */
-StgInt fileGetc PROTO((StgAddr));
+StgInt fileGetc PROTO((StgForeignObj));
/* fileLookAhead.lc */
-StgInt fileLookAhead PROTO((StgAddr));
+StgInt fileLookAhead PROTO((StgForeignObj));
/* filePosn.lc */
-StgInt getFilePosn PROTO((StgAddr));
-StgInt setFilePosn PROTO((StgAddr, StgInt));
+StgInt getFilePosn PROTO((StgForeignObj));
+StgInt setFilePosn PROTO((StgForeignObj, StgInt));
/* filePutc.lc */
-StgInt filePutc PROTO((StgAddr, StgInt));
+StgInt filePutc PROTO((StgForeignObj, StgInt));
/* fileSize.lc */
-StgInt fileSize PROTO((StgAddr, StgByteArray));
+StgInt fileSize PROTO((StgForeignObj, StgByteArray));
/* flushFile.lc */
-StgInt flushFile PROTO((StgAddr));
+StgInt flushFile PROTO((StgForeignObj));
/* getBufferMode.lc */
-StgInt getBufferMode PROTO((StgAddr));
+StgInt getBufferMode PROTO((StgForeignObj));
/* getClockTime.lc */
StgInt getClockTime PROTO((StgByteArray, StgByteArray));
/* getLock.lc */
int lockFile PROTO((int, int));
-void unlockFile PROTO((int));
-StgInt getLock PROTO((StgAddr, StgInt));
+int unlockFile PROTO((int));
+StgInt getLock PROTO((StgForeignObj, StgInt));
/* inputReady.lc */
-StgInt inputReady PROTO((StgAddr));
+StgInt inputReady PROTO((StgForeignObj));
/* openFile.lc */
StgAddr openFile PROTO((StgByteArray, StgByteArray));
+/* freeFile.lc */
+void freeStdChannel PROTO((StgForeignObj));
+void freeFile PROTO((StgForeignObj));
+
/* readFile.lc */
-StgInt readBlock PROTO((StgAddr, StgAddr, StgInt));
-StgInt readLine PROTO((StgAddr, StgAddr, StgInt));
-StgInt readChar PROTO((StgAddr));
+StgInt readBlock PROTO((StgAddr, StgForeignObj, StgInt));
+StgInt readLine PROTO((StgAddr, StgForeignObj, StgInt));
+StgInt readChar PROTO((StgForeignObj));
/* removeDirectory.lc */
StgInt removeDirectory PROTO((StgByteArray));
StgInt renameFile PROTO((StgByteArray, StgByteArray));
/* seekFile.lc */
-StgInt seekFile PROTO((StgAddr, StgInt, StgInt, StgByteArray));
-StgInt seekFileP PROTO((StgAddr));
+StgInt seekFile PROTO((StgForeignObj, StgInt, StgInt, StgByteArray));
+StgInt seekFileP PROTO((StgForeignObj));
/* setBuffering.lc */
-StgInt setBuffering PROTO((StgAddr, StgInt));
+StgInt setBuffering PROTO((StgForeignObj, StgInt));
/* setCurrentDirectory.lc */
StgInt setCurrentDirectory PROTO((StgByteArray));
StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgByteArray));
/* writeFile.lc */
-StgInt writeFile PROTO((StgAddr, StgAddr, StgInt));
+StgInt writeFile PROTO((StgAddr, StgForeignObj, StgInt));
#endif /* ! STGIO_H */