CC = gcc
CFLAGS = -resident -O2 -I.
LDFLAGS = -resident

all: InfoView MakeInfo

InfoView: info.o getopt.o getopt1.o
	$(CC) $(LDFLAGS) $< -o $@ -ltermcap

# order of the object files is critic, or pc-relative access > 16bit is
# tried
MakeInfo: makeinfo.o getopt.o getopt1.o
	$(CC) $(LDFLAGS) $< -o $@

info.o: info.c
	$(CC) $(CFLAGS) -msmall-code -c info.c

getopt1.o: getopt1.c getopt.h
	$(CC) $(CFLAGS) -msmall-code -c getopt1.c

getopt.o: getopt.c getopt.h
	$(CC) $(CFLAGS) -msmall-code -c getopt.c
