# ToDo revision 2.1 Makefile
#        Copyleft 1997-1998 ӂ (geh03706@nifty.ne.jp)
# g
#   make [build]	todo.exm 쐬
#   make wc		wc
#   make clean		objԃt@C폜
#   make clobber	\[X݂̂̏Ԃɖ߂
#   make archive	exmуhLg̃A[JCu
#   make source		\[Xt@C̃A[JCu
#   make upload		AbvpɁAׂč쐬
#

# *ˑ* CûpX
#   MYLIBPATH ... lx.lib/fia.lib ̏(Ă͂)
#   CLIBPATH  ... cs.lib ̏
#   NKITPATH  ... NKIT  TCC p obj ̏ (tccstart/tcclib/setime)
MYLIBPATH = a:\prog\lib
CLIBPATH = a:\ap\tc\lib
NKITPATH = a:\ap\tc\nkit

PROGRAM	= todo.exm
OBJS	= todo.obj key.obj date.obj numedit.obj\
	edit.obj clip.obj \
	scr.obj move.obj card.obj dcard.obj \
	env.obj file.obj csv.obj \
	ewin.obj find.obj help.obj frame.obj sort.obj title.obj miscwin.obj

LIBS	= $(MYLIBPATH)\lx.lib $(MYLIBPATH)\fia.lib \
	  $(NKITPATH)\tcclib.obj $(NKITPATH)\setime.obj $(CLIBPATH)\cs.lib
START	= $(NKITPATH)\tccstart.obj

CC	= tcc
CFLAGS	= -1 -O -Z -d -f-
LD	= tlink

RM	= -rm -f
LHA	= lha.exe

ARCHIVE	= todo21.lzh
SOURCE	= todo21s.lzh

###  ###

build: $(PROGRAM)

$(PROGRAM): $(OBJS)
	$(LD) @&&!
$(START) $(OBJS)
$*.exm
$*
$(LIBS)
!
	makeexm $*.map $*.exm 5

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

### \[Ẍˑ֌W ###

todo.obj:	todo.h
key.obj:	todo.h data.h
date.obj:	todo.h data.h

edit.obj:	todo.h data.h
clip.obj:	todo.h data.h

scr.obj:	todo.h data.h screen.h
move.obj:	todo.h data.h screen.h
card.obj:	todo.h data.h screen.h
dcard.obj:	todo.h data.h screen.h

env.obj:	todo.h data.h error.h
file.obj:	todo.h data.h error.h screen.h
csv.obj:	todo.h data.h error.h

ewin.obj:	todo.h data.h error.h
miscwin.obj:	todo.h data.h
find.obj:	todo.h data.h error.h
help.obj:	todo.h
frame.obj:	todo.h data.h screen.h
sort.obj:	todo.h data.h
title.obj:	todo.h data.h

### ̂ł͂Ȃ ###

wc:
	wc *.c *.h

clean:
	$(RM) *.obj *.map

clobber: clean
	$(RM) $(PROGRAM) $(ARCHIVE) $(SOURCE)

############

upload: archive source

archive: 
	lha a $(ARCHIVE) @&&!
readme.doc todo.doc todo.exm icon.doc
tutorial.tdb 4olduser.lzh exttl.lzh
faq.doc bugs.doc donation.doc \txt\gnu.lzh
!
	lha.exe a -z $(ARCHIVE) todo.icn todo2.icn

source:
	lha.exe a $(SOURCE) @&&!
source.doc filelist.txt
\txt\gnu.lzh
makefile
todo.h data.h screen.h error.h
todo.c key.c date.c numedit.c
edit.c clip.c
scr.c move.c card.c dcard.c
env.c file.c csv.c
ewin.c find.c help.c frame.c sort.c title.c miscwin.c
log
$(MYLIBPATH)\origlibs.lzh
!