REVISION=0.09
# [JCE] Added -DLINUX
DEFINES=	-DBIOS_SUPPORT		\
		-DDEBUG			\
		-DDOSS_SUPPORT          \
		-DLINUX

# [JCE] Files to go in the distribution tarball
#
TARBALL= Copying Changelog Makefile $(SRCS) \
		$(INCLUDES)  \
		userman.tex   README  GDE.RC

# un-done optimizations on decoding and execution
#	-DDELAY_FLAG_SET        

CC=cc 


LIBS = -lm
CFLAGS=  -I.  ${DEFINES} -g -pg

SRCS=	i86_prim_ops.c   \
	i86_decode.c     \
	i86_ops.c        \
	i87_ops.c	 \
	bios_svc_tab.c   \
	bios_time.c      \
	doss_ufs.c       \
	doss_svc_tab.c   \
	doss_dir.c	 \
	doss_time.c      \
	doss_mem.c       \
	doss_file.c	 \
	doss_proc.c      \
	doss_conio.c     \
	sys_debug.c		 \
	sys_init.c 	 \
	sys_config.c     \
	sys_cons.c       \
	doss_fs.c	\
	kbd_termios.c   \
	kbd_stdio.c     \
	main.c

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

BINARIES= gde

# gde.h ->  includes the following includes.
# i86.h ->  regs, prim ops, decode.
# i87.h ->  regs, prim ops.
# doss.h -> all DOSS stuff

INCLUDES= gde.h		\
	i86.h		\
	i87.h   	\
	doss.h		\
	kbd.h		\
	bios.h		\
	i86_externs.h	\
	i87_externs.h   \
	doss_externs.h	\
	bios_externs.h	\
	sys_debug.h	\
	sysdep.h	\
	ansidecl.h

all:	$(BINARIES)

tar:
	mkdir gde-$(REVISION)
	ln $(TARBALL) gde-$(REVISION)
	tar chvf gde-$(REVISION).tar gde-$(REVISION)/*
	cd gde-$(REVISION) && rm $(TARBALL) 
	rmdir gde-$(REVISION)
	gzip gde-$(REVISION).tar

gde: $(OBJS)
	${CC} $(CFLAGS) $(OBJS)	-o gde $(LIBS)

clean:
	rm -f *.o  $(BINARIES)  core gmon.out a.out
	-mv *~ junk

tests:
	gde testaopb.exe > testaopb.out
	gde testaopw.exe > testaopw.out
	gde testbopb.exe > testbopb.out
	gde testbopw.exe > testbopw.out


sys_init.o:sys_init.c            $(INCLUDES) Makefile
sys_config.o:sys_config.c            $(INCLUDES) Makefile
sys_debug.o: sys_debug.c                 $(INCLUDES) Makefile
sys_cons.o: sys_cons.c                   $(INCLUDES) Makefile

doss_conio.o:doss_conio.c	$(INCLUDES) Makefile
doss_fs.o:doss_fs.c	$(INCLUDES) Makefile
doss_file.o:doss_file.c          $(INCLUDES) Makefile
doss_mem.o:doss_mem.c            $(INCLUDES) Makefile
doss_time.o:doss_time.c          $(INCLUDES) Makefile
doss_ufs.o:doss_ufs.c            $(INCLUDES) Makefile
doss_proc.o:doss_proc.c		 $(INCLUDES) Makefile
doss_dir.o:doss_dir.c		 $(INCLUDES) Makefile
doss_svc_tab.o: doss_svc_tab.c   $(INCLUDES) Makefile


i86_ops.o: i86_ops.c             $(INCLUDES) Makefile
i86_prim_ops.o: i86_prim_ops.c   $(INCLUDES) Makefile 
i86_decode.o: i86_decode.c       $(INCLUDES) Makefile

i87_ops.o: i87_ops.c             $(INCLUDES) Makefile

bios_time.o: bios_time.c         $(INCLUDES) Makefile
bios_svc_tab.o: bios_svc_tab.c   $(INCLUDES) Makefile

kbd_termios.o: kbd_termios.c     $(INCLUDES) Makefile
kbd_stdio.o: kbd_stdio.c         $(INCLUDES) Makefile

main.o: main.c                   $(INCLUDES) Makefile


