##########################################################################
# Copyright (C) 1986-92 by FTP Software, Inc.
# 
#	  File: samples\dll\makefile
#	System: PC/TCP for MSWindows 3.X
#    Subsystem: PC/TCP Sample Windows Applications
#      History:
#		01-Apr-91  msd@ayuda	To FTP for 2.05 pl 2 beta.
#		xx-Jun-91  msd@ayuda	Begin work on 2.10 version.
#      Summary:
#		Makefile for the SAMPLES\DLL subtree.  Written for use with
#		a true (Unix-like) 'make' (e.g. Polytron's PolyMake)
#		-OR- Microsoft's nmake.exe
#
# note: this makefile assumes that the sample source to access the
#       UECHOSDL.DLL and some library source and/or objects are in
#       the subdirectory immediately above this one.
#
# Environment variables this makefile expects to be set:
#	INCLUDE		header file directory(s) (for CL)
#	LIB		library directory(s) (for LINK) -- note:
#			  you must be using the segmented linker
#	SDK		root of the MS Windows 3.0 SDK subtree
#
# Edit History:
#  22-Jul-92  rcq  made it nmake compatible and consistent with others
#  29-Sep-92  rcq  got rid of unneeded compile macros and changed "CFLAGS"
#		    to "WCFLAGS"
#
###########################################################################

LIBS = pctcpapi sdllcew libw

all:  ..\uechosdl.dll uechosdl.lib

# The next lines for debugging in CodeView (or CodeView/Windows)
#CFLAGS = $(DEBUG) -Od -Gsw -Zl -Zp -W3 -ASw -Zi
#LFLAGS = /M/NOD/CO
# --or-- the next lines for general release

##### -Gsw for no stack probes (windows)    ####
##### -ASw for DS != SS in the DLL context! ####
WCFLAGS = $(DEBUG) -Od -Gsw -Zp -Zl -ASw
LFLAGS = /M/NOD

SDKDIR  =$(SDK)
MSOBJ   =$(SDKDIR)\lib\libentry.obj

LIBOBJS = ..\cgarf.wo ..\fmters.wo ..\oplaint.wo ..\pplaint.wo
OBJS    = uechosdl.wo dllglue.wo

###############################  uechosdl  ###############################
#
# To avoid creating a command line too long for make to handle, we create
#  a temporary "link reference file" with commands on seperate lines, then
#  feed this file to the linker.

..\uechosdl.dll: $(OBJS) $(MSOBJ) $(LIBOBJS)
	echo $(MSOBJ) $(OBJS) $(LIBOBJS)		> link_ref.tmp
	echo $@	$(LFLAGS) 				>>link_ref.tmp 
	echo uechosdl					>>link_ref.tmp
	echo $(LIBS)					>>link_ref.tmp
	echo uechosdl.def 				>>link_ref.tmp
	link @link_ref.tmp			
	del  link_ref.tmp
	rc ..\uechosdl.dll

uechosdl.map: ..\uechosdl.dll


# For the debugger, make a symbols file.
uechosdl.sym:  uechosdl.map
	mapsym uechosdl.map

# Create the import library.
uechosdl.lib:  uechosdl.def
	implib uechosdl.lib uechosdl.def

#dllglue.wo:

uechosdl.wo:  uechosdl.c  ..\fmters.h ..\plaints.h uechosdl.h 
	cl $(WCFLAGS) -c -Fo$@ uechosdl.c


###############################  library  ################################

..\cgarf.wo:  ..\cgarf.c ..\cgarf.h
	cl $(WCFLAGS) -c -Fo$@ ..\cgarf.c
	
..\fmters.wo:  ..\fmters.c ..\fmters.h
	cl $(WCFLAGS) -c -Fo$@ ..\fmters.c
	
..\oplaint.wo:  ..\oplaint.c ..\plaints.h
	cl $(WCFLAGS) -c -Fo$@ ..\oplaint.c
	
..\pplaint.wo:  ..\pplaint.c ..\plaints.h ..\fmters.h
	cl $(WCFLAGS) -c -Fo$@ ..\pplaint.c
	
#############################  housekeeping  #############################

clean:	
	del *.?o
	del *.obj
	del *.bak
	del *.map
	del *.tmp
cleanall: clean
	del *.exe
	del *.dll
	del *.lib

# eof
