# Makefile for REMIND

#-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW
#-----------------------------------------------------------------------------

# Uncomment the next line if you are running on a SYSV system
# SYSV= -DSYSV

# Uncomment the next line if you are running on any type of UNIX system
UNIX= -DUNIX

# Uncomment the next line if you want to use gcc instead of default compiler
CC= gcc

# Put any additional flags for the C compiler here
CFLAGS= -O -ansi
CDEFS=

#-----------------------------------------------------------------------------
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
VERSION= 03.00.00

HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
STDHDRS= config.h types.h protos.h globals.h err.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c

MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1

OBJS= $(SRCS:.c=.o)

remind: $(OBJS)
	$(CC) -o remind $(OBJS)

.c.o:
	$(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c

clean:
	rm -f *.o *~

calendar.o: calendar.c $(STDHDRS) expr.h
dorem.o: dorem.c $(STDHDRS) expr.h
dosubst.o: dosubst.c $(STDHDRS)
expr.o: expr.c $(STDHDRS) expr.h
files.o: files.c $(STDHDRS)
funcs.o: funcs.c $(STDHDRS) expr.h version.h
globals.o: globals.c config.h types.h globals.h err.h
init.o: init.c $(STDHDRS) expr.h version.h
main.o: main.c $(STDHDRS) expr.h
omit.o: omit.c $(STDHDRS)
queue.o: queue.c $(STDHDRS)
token.o: token.c $(STDHDRS)
trigger.o: trigger.c $(STDHDRS) expr.h
userfns.o: userfns.c $(STDHDRS) expr.h
utils.o: utils.c $(STDHDRS)
var.o: var.c $(STDHDRS) expr.h

tarZ:
	tar cvf remind-3.0.0.tar $(MANIFEST)
	compress -v remind-3.0.0.tar

shar:
	shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)

todos:
	mdel 'a:*.*'
	mdel 'a:*'
	mcopy -tn $(MANIFEST) a:

fromdos:
	mcopy -tn 'a:*' .
	-mv -f copyrigh COPYRIGHT
	-mv -f makefile Makefile
	-mv -f readme.dos README.DOS
	-mv -f readme.uni README.UNIX
	-mv -f remind-a.csh remind-all.csh
	-mv -f remind-a.sh remind-all.sh
	-mv -f manifest.dos MANIFEST.DOS
	-mv -f manifest.unx MANIFEST.UNX
	-mv -f whatsnew.30 WHATSNEW.30
	-chmod u+x test-rem

backup:
	cp $(MANIFEST) ../backup

transmit:
	sz -a -Z -e $(MANIFEST)
