################################################################################
#                                                                              #
#	Makefile for curses                                                    #
#	(Now compatible with MAKE that comes with TURBO C)                     #
#                                                                              #
################################################################################

#### INCDIR	Where the curses include files are kept.
#### CC		Command to execute C compiler
#### CFLAGS	Flags to pass to C compiler.
#### LIB	Command to execute the librarian.
#### LFLAGS	Flags to pass to librarian.

INCDIR		= .

CC		= tcc
LIB		= tlib

CFLAGS		= -ms -O -v
LFLAGS		= /c

#LFLAGS		= /c /e
#CFLAGS		= -ms -O -v-

#### Note: 	For some reason, using the '/e' switch in TLIB prevents
####		debugging information from being included in the library.
####		If you are using the '-v' flag in CFLAGS, you should also
####		set LFLAGS to be "/c" and not "/c /e".

all:		lib

lib:		curses.lib
		@echo Library is up to date

t:		t.exe
t.obj:		t.c $(INCDIR)\curses.h

t.exe:		t.obj curses.lib
		$(CC) $(CFLAGS) t.obj curses.lib

curses.obj:	curses.c $(INCDIR)\curses.h
v_msdos.obj:	v_msdos.c $(INCDIR)\curses.h

curses.lib:	curses.obj v_msdos.obj
		@rm -f curses.lib
		$(LIB) $(LFLAGS) curses.lib +curses.obj \
					    +v_msdos.obj

.c.obj:
		$(CC) $(CFLAGS) -c $<

clean:
		rm -f *.obj *.map *.exe *.bak curses.lib
