--- mstools/samples/comm/makefile 2018/08/09 18:20:59 1.1 +++ mstools/samples/comm/makefile 2018/08/09 18:24:32 1.1.1.3 @@ -1,30 +1,48 @@ # Windows-32 TTY Example -# Copyright (c) 1991 by Microsoft Corporation - -# inference rules +# Copyright (c) 1992 by Microsoft Corporation +!IF "$(CPU)" != "" +OS=NT +ENV=WIN32 +!ELSE +OS=DOS +ENV=WIN16 +!ENDIF + +# If this generates the error "Unable to open DOSWIN16.MAK" then you need +# to put a copy of that file (from the GENERIC sample code directory) +# into a directory on your INCLUDE environment variable + +!include <$(OS)$(ENV).MAK> + +proj = TTY + +all: $(proj).exe + +# Update the resource if necessary +$(proj).res: $(proj).rc resource.h + rc -r -fo $(proj).res $(cvars) $(proj).rc +!IFDEF CPUTYPE + cvtres -$(CPU) $(proj).res -o $(proj).rbj +!ENDIF + + +# Update the object file if necessary +$(proj).obj: $(proj).c $(proj).h + $(cc) $(cdebug) $(cflags) $(cvars) $(proj).c + +# Since the link line has some severe differences depending on what +# platform we are running on, we need to special case this so that +# we execute the correct commands: + +$(proj).exe: $(proj).obj $(proj).res $(proj).def +!IFDEF CPUTYPE +# This is for Windows NT: + $(link) $(linkdebug) $(guiflags) $(proj).obj $(guilibs) VERSION.LIB $(proj).rbj -out:$(proj).exe +!ENDIF +!IFNDEF CPUTYPE +# This is for Windows DOS: + $(link) $(guiflags) $(proj).obj $(guilibs) $(proj).DEF + rc $(proj).res +!ENDIF !include - -.c.obj: - $(cc) $(cflags) $(cvars) $*.c >$*.err - -EXEOBJECTS = tty.obj - -all: tty.exe - -clean: - del *.obj - del *.map - -tty.h: resource.h version.h - -tty.obj: tty.c tty.h - -tty.res: tty.rc tty.ico tty.bmp resource.h - rc -r -dWIN32 -fo res.tmp tty.rc - cvtres -$(CPU) res.tmp -o tty.res - del res.tmp - -tty.exe: $(EXEOBJECTS) tty.res tty.def - $(cvtobj) $(cvtdebug) *.obj - $(link) $(guiflags) -out:tty.exe tty.obj tty.res $(guilibs)