### -*-Midas-*-
###
-### $Id: i386.m4,v 1.44 1996/03/04 20:31:56 cph Exp $
+### $Id: i386.m4,v 1.45 1996/10/02 18:53:21 cph Exp $
###
### Copyright (c) 1992-96 Massachusetts Institute of Technology
###
### If defined, external symbol names are generated as written;
### otherwise, they have an underscore prepended to them.
### CALLER_ALLOCS_STRUCT_RETURN
+### STATIC_STRUCT_RETURN
### Controls the conventions used to return 8-byte structs from C
-### procedures. If defined, the caller allocates space on the
-### stack and passes a pointer to that space on the top of the
-### stack. Otherwise, the callee returns the struct in EAX/EDX.
+### procedures. If CALLER_ALLOCS_STRUCT_RETURN is defined, the
+### caller allocates space on the stack and passes a pointer to
+### that space on the top of the stack. If STATIC_STRUCT_RETURN
+### is defined, the callee returns a pointer to a static struct in
+### EAX. Otherwise, the callee returns the struct in EAX/EDX.
+### WCC386
+### Should be defined when using Watcom assembler.
### WCC386R
### Should be defined when using Watcom assembler and generating
### code to use the Watcom register-based argument conventions.
IFDOS(`define(DASM,1)')
IF_WIN32(`define(DASM,1)')
+ifdef(`WCC386R',`define(WCC386,1)')
ifdef(`DASM',
`define(IFDASM,`$1')',
IFOS2(`define(CALLER_ALLOCS_STRUCT_RETURN,1)')
IF_LINUX_ELF(`define(CALLER_ALLOCS_STRUCT_RETURN,1)')
+
+IFDOS(`define(`STATIC_STRUCT_RETURN',1)')
+IF_WIN32(`ifdef(`WCC386', `define(`STATIC_STRUCT_RETURN',1)')')
\f
DECLARE_CODE_SEGMENT()
declare_alignment(2)
')
OP(add,l) TW(IMM(16),REG(esp)) # Pop utility args
-IFDOS(`
+ifdef(`STATIC_STRUCT_RETURN',`
OP(mov,l) TW(LOF(4,REG(eax)),REG(edx))
OP(mov,l) TW(IND(REG(eax)),REG(eax))
')
### -*- Fundamental -*-
###
-### $Id: makefile.wcc,v 1.3 1995/10/25 05:01:08 cph Exp $
+### $Id: makefile.wcc,v 1.4 1996/10/02 18:50:56 cph Exp $
###
-### Copyright (c) 1992-95 Massachusetts Institute of Technology
+### Copyright (c) 1992-96 Massachusetts Institute of Technology
###
### This material was developed by the Scheme project at the
### Massachusetts Institute of Technology, Department of
WRCFLAGS_SYSTEM = /i=$(%NT_INCLUDE)
!else
UTIL_SYSTEM = nt
-WRCFLAGS_SYSTEM =
+WRCFLAGS_SYSTEM = /i=$(%NT_INCLUDE)
!endif
# Compiler options.
# [OPTIMIZE] marks options used for optimization.
#
# /4r 386 instructions, 486 timings, register-based args
+# /bd build NT DLL
# /bt=nt build NT binary (default when host is NT)
# /d1+ generate debug info [OPTIMIZE]
# /d2 generate debug info [DEBUG]
# /DMIT_SCHEME required to specialize some code
# /DGUI configure a console window
# omitted: /DNO_CONST /Di386
-UTIL_CFLAGS = /4r /d2 /ei /fpi /fp3 /op /s /w0 /zc /zp4 /zq
-CFLAGS = $(UTIL_CFLAGS) /bt=nt /DMIT_SCHEME /DGUI
+UTIL_CFLAGS = /4r /d2 /ei /fpi /fp3 /op /s /w1 /zc /zp4 /zq
+CFLAGS = $(UTIL_CFLAGS) /DMIT_SCHEME /DGUI
# Linker options.
#
# debug all include debug info in executable
# option caseexact use case-sensitive comparison for identifiers
+# option map create a .map file
# option quiet operate quietly
# option symfile put debug info in .sym file
-LDFLAGS = debug all option caseexact option quiet
+LDFLAGS = debug all option caseexact option map option quiet
# M4 options.
#
# /zq operate quietly
ASFLAGS = /bt=nt /d1 /fpi /fp3 /mf /zq
-all : scheme.exe bchschem.exe bintopsb.exe psbtobin.exe
+# Library Manager options.
+#
+# /b Suppress backup file
+# /c case-sensitive comparison
+# /n produce a new output file
+# /q operate quietly
+WLIB_FLAGS = /b /c /n /q
+
+all : scheme.exe bchschem.exe scheme32.dll bintopsb.exe psbtobin.exe
.c.obj :
$(CC) $(CFLAGS) $[@
library { ntscmlib.lib $(SCHEME_LIB) }
wrc /q /ad /bt=nt ntgui.res $^@
+ntscmlib.lib : scheme32.dll
+ wlib $(WLIB_FLAGS) $^@ +$[@
+
+scheme32.dll : scheme32.obj scheme32.lnk scheme32.lbc
+ wlink $(LDFLAGS) @scheme32.lnk
+
+scheme32.obj : scheme32.c ntscmlib.h
+ $(CC) /bd $(CFLAGS) $[@
+
bintopsb.exe : bintopsb.obj missing.obj
wlink system nt $(LDFLAGS) name $^@ file { $< }
findprim.obj : findprim.c
$(CC) $(UTIL_CFLAGS) $[@
-ntscmlib.lib : ntscmlib.lbc
- wlib /b /c /n /q $^@ @$[@
-
# Update the resource if necessary
ntgui.res : ntgui.rc ntgui.h ntdialog.dlg ntdialog.h
wrc /q /ad /bt=nt /r /x /D__WATCOMC__ $(WRCFLAGS_SYSTEM) $[@