--- mstools/samples/rpc/mandel/makefile 2018/08/09 18:20:01 1.1 +++ mstools/samples/rpc/mandel/makefile 2018/08/09 18:21:59 1.1.1.3 @@ -10,18 +10,18 @@ # sample application. The flag RPC determines which version # is built. To build a standalone version, use the commands: # >nmake cleanall -# >set RPC= +# >set NOTRPC=1 # >nmake # To build the RPC version, use the commands: # >nmake cleanall -# >set RPC=1 +# >set NOTRPC= # >nmake !include -!ifdef RPC -RPCFLAG = -DRPC -!else +!ifdef NOTRPC RPCFLAG = +!else +RPCFLAG = -DRPC !endif # Establish the inference rules. @@ -29,49 +29,49 @@ RPCFLAG = # remove -std switch from compiler switches # Use different command line input for object conversion. -!if "$(CPU)" == "i386" -CONVERTOBJECTCMD = $(cvtobj) $@ +cvtomf = +!if "$(CPU)" == "MIPS" +cvtomf = mip2coff $@ !endif -!if "$(CPU)" == "MIPS" -cflags = -c -G0 -O -EL -DMIPS=1 -I\nt\mstools\h -CONVERTOBJECTCMD = $(cvtobj) +!if "$(CPU)" == "i386" +# workaround for Windows NT 10/92 beta +cflags = $(cflags:G3=Gz) !endif .c.obj: $(cc) $(cflags) $(cvars) $(RPCFLAG) $< - $(CONVERTOBJECTCMD) + $(cvtomf) # Targets # The RPC version produces client and server executables. # The standalone version produces a single exe file, "mandel". -!ifdef RPC +!ifndef NOTRPC all: client.exe server.exe !else all: mandel.exe !endif -mandel.exe: mandel.obj remote.obj mandel.def mandel.res calc.obj +mandel.exe: mandel.obj remote.obj mandel.def mandel.rbj calc.obj $(link) $(guiflags) -out:mandel.exe -map:mandel.map \ - mandel.obj remote.obj calc.obj mandel.res $(guilibs) + mandel.obj remote.obj calc.obj mandel.rbj $(guilibs) -client.exe: mandel.obj remote.obj mandel.def mandel.res \ +client.exe: mandel.obj remote.obj mandel.def mandel.rbj \ mdlrpc_c.obj mdlrpc_x.obj $(link) $(guiflags) -out:client.exe -map:client.map \ mandel.obj remote.obj mdlrpc_c.obj mdlrpc_x.obj \ - mandel.res $(guilibs) $(LIB)\winrpc.lib $(LIB)\ndrlib.lib + mandel.rbj rpcrt4.lib rpcndr.lib $(guilibs) server.exe: server.obj calc.obj mdlrpc_s.obj mdlrpc_y.obj $(link) $(conflags) -out:server.exe -map:server.map \ server.obj calc.obj mdlrpc_s.obj mdlrpc_y.obj \ - $(conlibs) $(LIB)\winrpc.lib $(LIB)\ndrlib.lib + rpcrt4.lib rpcndr.lib $(conlibs) # Update the resource if necessary -mandel.res: mandel.rc mandel.h - rc -r -fo res.tmp mandel.rc - cvtres -$(CPU) res.tmp -o mandel.res - del res.tmp +mandel.rbj: mandel.rc mandel.h + rc -r mandel.rc + cvtres -$(CPU) mandel.res -o mandel.rbj # Object file dependencies @@ -79,14 +79,14 @@ mandel.res: mandel.rc mandel.h server.obj: server.c mandel.h mdlrpc.h # Compile differently for RPC, standalone versions -!ifdef RPC +!ifndef NOTRPC mandel.obj: mandel.c mandel.h mdlrpc.h remote.obj: remote.c mandel.h mdlrpc.h calc.obj : calc.c mandel.h mdlrpc.h !else mandel.obj: mandel.c mandel.h remote.obj: remote.c mandel.h -calc.obj: calc.c mandel.h +calc.obj: calc.c mandel.h !endif # client stub @@ -94,7 +94,6 @@ mdlrpc_c.obj : mdlrpc_c.c mdlrpc.h # use lower warning levels for the stub source code; add -W1 !if "$(CPU)"=="i386" $(cc) $(cflags) $(cvars) -W1 mdlrpc_c.c - $(CONVERTOBJECTCMD) !endif # client auxiliary file @@ -102,7 +101,6 @@ mdlrpc_x.obj : mdlrpc_x.c mdlrpc.h # use lower warning levels for the stub source code; add -W1 !if "$(CPU)"=="i386" $(cc) $(cflags) $(cvars) -W1 mdlrpc_x.c - $(CONVERTOBJECTCMD) !endif # server stub file @@ -110,7 +108,6 @@ mdlrpc_s.obj : mdlrpc_s.c mdlrpc.h # use lower warning levels for the stub source code; add -W1 !if "$(CPU)"=="i386" $(cc) $(cflags) -W1 $(cvars) mdlrpc_s.c - $(CONVERTOBJECTCMD) !endif # server auxiliary file @@ -118,12 +115,11 @@ mdlrpc_y.obj : mdlrpc_y.c mdlrpc.h # use lower warning levels for the stub source code; add -W1 !if "$(CPU)"=="i386" $(cc) $(cflags) $(cvars) -W1 mdlrpc_y.c - $(CONVERTOBJECTCMD) !endif # Stubs, auxiliary and header file from the IDL file mdlrpc.h mdlrpc_c.c mdlrpc_x.c mdlrpc_s.c mdlrpc_y.c: mdlrpc.idl mdlrpc.acf - midl -cpp_cmd $(cc) -cpp_opt "-E" mdlrpc.idl + midl mdlrpc.idl clean: -del client.exe @@ -134,6 +130,7 @@ cleanall: clean -del *.o -del *.oo -del *.res + -del *.rbj -del *.map -del *.obj -del mdlrpc.h