# MSC Makefile for the Eiffel DLL for Codewright
# based on BASIC module makefile
# tested under NT only -- FA 3/94

!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>
linkdebug=
cdebug=-Osw

proj = cweiffel

CWINCLUDE = -I..\include
CWLIB     = ..\lib
all:  $(proj).dll $(proj).exp clean
localflags = -Zp1


# Update the object file if necessary
$(proj).obj: $(proj).c
    $(cc) -DSTRICT $(cflags) $(localflags) $(cvarsdll) $(CWINCLUDE) $(cdebug) $(proj).c

# Update the import library
$(proj).exp: $(proj).def $(proj).obj
    lib32 -machine:$(CPU) $(proj).obj -def:$(proj).def -out:$(proj).lib

# 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).dll: $(CWLIB)\cw32.lib $(CWLIB)\cwstart.lib $(proj).obj $(proj).exp 
	$(link) -DLL $(linkdebug) $(guiflags) -out:$(proj).dll \
		-base:0x1C000000 -entry:DLLEntry$(DLLENTRY) $(proj).obj $(proj).exp \
		$(guilibsdll) $(CWLIB)\cw32.lib $(CWLIB)\cwstart.lib VERSION.LIB

# clean
clean:
	del $(proj).obj
	del $(proj).exp
	del $(proj).lib