#
# Global Makefile for the MOOSE Project
#


########################## User parameters: ###########################

### MOOSE Directory. Change it to its value on your system.


### Version number

# for linux-like versions, add a letter to the patch-level number :)
# negative major version number: still no MOOSE feature implemented.
MAJOR_VERSION	= -1
MINOR_VERSION	= 0
PATCH_LEVEL	= 0

### External Utilities
SHELL	= /bin/sh
RM	= /bin/rm -f
CC	= gcc
CPP	= gcc -E
LD	= ld
TASM	= dos -E tasm
TLINK	= dos -E tlink

### Flags for these utilities

LDFLAGS		= -s -Lc
CFLAGS		= -O6 -fomit-frame-pointer -Wall -Wstrict-prototypes -pipe \
		  -funsigned-char -fomit-frame-pointer
TASMFLAGS	= /s /r /l /ml /m5 /p /z /zi
TLINKFLAGS	= /m /l /s /3 /c


### Rules


.asm.bin:	boot/i386/macro.inc boot/i386/mem386.inc
	dos -E \
	'LREDIR h: $(MOOSE) \
	 h: \
	 cd boot\API \
	 asm  $* \
	 link $* \
	 exe2bin $*'


### Targets

all:	version.h

version.h:
	(echo "#define MOOSE_VERSION" \
	     '"$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)"' ; \
	 echo "#define MOOSE_MAJOR_VERSION $(MAJOR_VERSION)" ; \
	 echo "#define MOOSE_MINOR_VERSION $(MINOR_VERSION)" ; \
	 echo "#define MOOSE_PATCH_LEVEL   $(PATCH_LEVEL)"   ; \
	) > version.h

clean:
	for i $(BOOTSUBDIRS) ; do \
	  $(RM)	*.o *.a \
		*.lst *.crf *.xrf *.obj *.map *.exe *.bin \
		*~ '#*#' \
		core zap zep zip zop zup foo bar ;\
	done

install: all
	cd bin ; \
	chmod a+x install.sh ; \
	./install.sh

depend dep:
	sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
	for i in *.c ;do $(CPP) -MM $$i;done >> tmp_make
	mv tmp_make Makefile
	# doesn't take into account asm files !!!

dummy:

### Dependencies don't edit below; automatically generated !
