# -------- ZIL?.LIB --------

# Zinc Interface Library makefile.
#
# This makefile creates the library files from the source code.
# Be sure that the TURBOC.CFG file (in the same directory as TCC.EXE)
# is set up for your system configuration.  If you installed Turbo C++
# to the default directory then the file should read:
#     -L\tc\lib;-I\tc\include
#
# To use this makefile type 'make' followed by the possible options:
#     make                    Makes large model library (with -Y overlay option).
#     make -DMODEL=l          Makes large model library (w/o -Y overlay option).
#     make -DMODEL=m          Makes medium model library.
#     make -DMODEL=c          Makes compact model library.
#     make -DMODEL=s          Makes small model library.

### Production (check for overlay option)
!if !$d(MODEL)
COPTS=-O -Z -w -P -Y -c
MODEL=l
!else
COPTS=-O -Z -w -P -c
!endif

### Debugging
#COPTS=-v -w -P -c

### Zinc information
INCLUDE=..\include
LIB=..\lib

### Set up the object file sub-directory
OBJ_DIR=$(MODEL)

.SWAP
.PATH.obj=$(OBJ_DIR)
.PATH.lib=$(LIB)
.cpp.obj :
	tcc -I$(INCLUDE) -n$(OBJ_DIR) -m$(MODEL) $(COPTS) {$< }

zil$(MODEL).lib: DIR border.obj button.obj country.obj cursor.obj date.obj \
	dateexp.obj dateimp.obj datewin.obj device.obj display.obj error.obj \
	errorwin.obj event.obj fmtstr.obj gdisplay.obj g_error.obj g_event.obj \
	g_help.obj g_hotkey.obj g_pback.obj g_perror.obj g_phelp.obj \
	g_pnorm.obj help.obj helpwin.obj icon.obj keyboard.obj list.obj \
	listblk.obj map.obj map1.obj matrix.obj max.obj min.obj misc.obj \
	mouse.obj number.obj numbere.obj numfe.obj numfval.obj numvalid.obj \
	path.obj popup.obj prompt.obj pulldown.obj pwindow.obj scroll.obj \
	string.obj sys.obj tdisplay.obj text.obj text1.obj time.obj timeexp.obj \
	timeimp.obj timewin.obj title.obj undo.obj undolist.obj window.obj \
	window1.obj window2.obj
	@cd $(OBJ_DIR)
	@tlib.exe /C @&&!
zil$(MODEL).lib &
+border+button+country+cursor+date+dateexp+dateimp+datewin+device+display &
+error+errorwin+event+fmtstr+gdisplay+g_error+g_event+g_help+g_hotkey &
+g_pback+g_perror+g_phelp+g_pnorm+help+icon+helpwin+keyboard+list+listblk &
+map+map1+matrix+max+min+misc+mouse+number+numbere+numfe+numfval+numvalid &
+path+prompt+popup+pulldown+pwindow+scroll+string+sys+tdisplay+text+text1 &
+time+timeexp+timeimp+timewin+title+undo+undolist+window+window1+window2
!
	@copy zil$(MODEL).lib ..\$(LIB)
	@del zil$(MODEL).lib
	@cd ..

DIR :
	md $(OBJ_DIR)
