#
# 'vile' and 'mktbls' makefile for IBM C Set ++ 2.x (OS/2)
# $Id: makefile.icc,v 1.20 2009/12/24 09:18:58 tom Exp $
#

#
# Compiler flags:
#
CC = icc

# Debug options:
#DEBUG_FLAGS = /Ti+ /Wpor /Wext /Wuse /Wini /Wuni /Wgot
#DEBUG_FLAGS = /Ti+ /Wpor /Wext /Wuse /Wini /Wgot

# Production options:
PROD_FLAGS  = /O+

#
CFLAGS = /Q /I . /Wpro $(DEBUG_FLAGS) /Dscrn_chosen /DDISP_VIO=1

# File extension for object files:
O = .obj

# File extension for executable files:
E = .exe

# What source file should be built for display support?  (.c suffix assumed)
SCREEN = os2vio

MKTBLS = .\mktbls$E
TARGET = vile$E

BUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nename.h nevars.h nefkeys.h nefsms.h

all:	$(TARGET)

clean:
	-del *$O
	-del *.bak
	-del ne*.h
	-del $(MKTBLS)

clobber:	clean
	-del *$E

#		*List Macros*


MKTBLS_DEPS =\
mktbls$O

#		*Explicit Rules*
$(MKTBLS): $(MKTBLS_DEPS)
	$(CC) $(CFLAGS) $(MKTBLS_DEPS) /Fe$@

#		*Individual File Dependencies*
mktbls$O: mktbls.c

VILE_DEPS =  \
 basic$O \
 bind$O \
 blist$O \
 btree$O \
 buffer$O \
 csrch$O \
 display$O \
 dumbterm$O \
 eval$O \
 exec$O \
 externs$O \
 fences$O \
 file$O \
 filec$O \
 fileio$O \
 finderr$O \
 glob$O \
 globals$O \
 history$O \
 input$O \
 insert$O \
 isearch$O \
 itbuff$O \
 line$O \
 main$O \
 map$O \
 modes$O \
 msgs$O \
 npopen$O \
 nullterm$O \
 oneliner$O \
 opers$O \
 os2pipe$O \
 path$O \
 random$O \
 regexp$O \
 region$O \
 search$O \
 select$O \
 spawn$O \
 statevar$O \
 tags$O \
 tbuff$O \
 termio$O \
 ucrypt$O \
 undo$O \
 version$O \
 vl_ctype$O \
 window$O \
 word$O \
 wordmov$O \
 $(SCREEN)$O

#		*Explicit Rules*

version:
	@-del version$O

$(TARGET) : $(VILE_DEPS)
  $(CC) $(CFLAGS) $(VILE_DEPS) /Fe$@

#		*Individual File Dependencies*
VILE_CFG=	estruct.h nefkeys.h nemode.h edef.h proto.h

basic$O:	$(VILE_CFG) basic.c

bind$O:		$(VILE_CFG) bind.c	nefunc.h	btree.h

blist$O:	$(VILE_CFG) blist.c 	blist.h

btree$O:	$(VILE_CFG) btree.c 	btree.h

buffer$O:	$(VILE_CFG) buffer.c

csrch$O:	$(VILE_CFG) csrch.c

display$O:	$(VILE_CFG) display.c

dumbterm$O:	$(VILE_CFG) dumbterm.c

eval$O:		$(VILE_CFG) eval.c	nevars.h

exec$O:		$(VILE_CFG) exec.c 	nefunc.h

externs$O:	$(VILE_CFG) externs.c	nebind.h nename.h nefunc.h

fences$O:	$(VILE_CFG) fences.c

file$O:		$(VILE_CFG) file.c

filec$O:	$(VILE_CFG) filec.c	dirstuff.h

fileio$O:	$(VILE_CFG) fileio.c

finderr$O:	$(VILE_CFG) finderr.c

glob$O:		$(VILE_CFG) glob.c	dirstuff.h

globals$O:	$(VILE_CFG) globals.c 	nefunc.h

history$O:	$(VILE_CFG) history.c

input$O:	$(VILE_CFG) input.c

insert$O:	$(VILE_CFG) insert.c

isearch$O:	$(VILE_CFG) isearch.c

itbuff$O:	$(VILE_CFG) itbuff.c

line$O:		$(VILE_CFG) line.c

map$O:		$(VILE_CFG) map.c

modes$O:	$(VILE_CFG) modes.c

msgs$O:		$(VILE_CFG) msgs.c

npopen$O:	$(VILE_CFG) npopen.c

nullterm$O:	$(VILE_CFG) nullterm.c

oneliner$O:	$(VILE_CFG) oneliner.c

opers$O:	$(VILE_CFG) opers.c 	nefunc.h

os2pipe$O:	$(VILE_CFG) os2pipe.c

path$O:		$(VILE_CFG) path.c	dirstuff.h

random$O:	$(VILE_CFG) random.c	nefunc.h

regexp$O:	$(VILE_CFG) regexp.c

region$O:	$(VILE_CFG) region.c

search$O:	$(VILE_CFG) search.c

select$O:	$(VILE_CFG) select.c 	nefunc.h

statevar$O:	$(VILE_CFG) statevar.c 	nevars.h

spawn$O:	$(VILE_CFG) spawn.c 	nefunc.h

tags$O:		$(VILE_CFG) tags.c 	btree.h

tbuff$O:	$(VILE_CFG) tbuff.c

termio$O:	$(VILE_CFG) termio.c 	nefunc.h

ucrypt$O:	$(VILE_CFG) ucrypt.c

undo$O:		$(VILE_CFG) undo.c

version$O:	$(VILE_CFG) version.c 	patchlev.h

vl_ctype$O:	$(VILE_CFG) version.c 	vl_ctype.h

window$O:	$(VILE_CFG) window.c

word$O:		$(VILE_CFG) word.c 	nefunc.h

wordmov$O:	$(VILE_CFG) wordmov.c

main$O:		$(VILE_CFG) main.c	nevars.h

$(SCREEN)$O:	$(VILE_CFG) $(SCREEN).c os2keys.h

nebind.h \
nefunc.h \
nefkeys.h \
nename.h :	cmdtbl $(MKTBLS)
	@echo making $@
	$(MKTBLS) cmdtbl

nevars.h \
nefsms.h \
nemode.h:	modetbl $(MKTBLS)
	@echo making $@
	$(MKTBLS) modetbl
