CWD=/usr1/users/eric/src/ibcs



#
# These are the default locations for the COFF/ELF versions of the files.
# Define them now so that we can override if we want to.
#
ASFLAG  =-B$(ASDIR)
AS	=$(ASDIR)as
LD	=$(ASDIR)ld
AR	=$(ASDIR)ar
STRIP	=$(ASDIR)strip
RANLIB	=$(ASDIR)ranlib
MV	=mv
RM	=rm
NM      =nm
CP	=cp
CPP	=$(CC) -E -P -c


ifdef COFF
ASDIR   =/usr/bin/coff/
LD=$(ASDIR)ld
# standard CFLAGS for creating the object files. These flags are given to
# all of the lower level makefiles.
CFLAGS1	=-I$(CWD)/include -DCOFF_LIBRARY
CFLAGS	=-Wall -Wstrict-prototypes -O6 -fomit-frame-pointer -pipe \
	 $(CFLAGS1) -B$(ASDIR)
endif

#For now, the ELF library is built on SVr4.  Use system CC, so that
#we can build the PIC library.
ifdef ELF
ASDIR   =/usr/bin/
CFLAGS1	= -nostdinc -I$(CWD)/include  -DNO_UNDERSCORE -DELF_LIBRARY -D__PIC__ 
CFLAGS = -O -fPIC -g $(CFLAGS1)
LD_SHLIBFLAG=-G
CC=/usr/local/bin/gcc
RANLIB	=echo
PIC=true
endif

#Build the ELF library under any platform using the GNU tools.
#Assume all of the tools are in ASDIR.  Ultimately you will be able
#to use the system binutils for this purpose.
ifdef GNUELF
ASDIR   =/usr/i486-linuxelf/bin
CFLAGS1	= -nostdinc -I$(CWD)/include  -DNO_UNDERSCORE -DELF_LIBRARY -D__PIC__ -b i486-linuxelf
CFLAGS = -O -B$(ASDIR)/ -fPIC -g $(CFLAGS1)
AS=$(ASDIR)/as
AR	=ar
STRIP	=strip
LD=/usr/bin/ld -m elf_i386
LD_SHLIBFLAG=--shared
NM=nm
CC=gcc
RANLIB	=echo
PIC=true
ELF=true  #So a lot of the conditional stuff in the Makefiles works.
endif


# The aout version of the library is only used for a static version that
# can be used for testing and debugging of the overall library.
ifdef AOUT
#CWD =/usr1/users/eric/ibcs
ASDIR   =/usr/bin/
CFLAGS1	= -nostdinc -I$(CWD)/include -DAOUT_LIBRARY
#CFLAGS = -O -g $(CFLAGS1)
CFLAGS =  -g $(CFLAGS1)
CC=gcc
endif


ifdef TEST
PIC=true
ASDIR   =/usr/local/lib/gcc-lib/i486-linux/2.5.3-elf/
CFLAGS1	= -nostdinc -I$(CWD)/include -DELF_LIBRARY  -DNO_UNDERSCORE -V 2.5.3-elf -D__PIC__ 
#CFLAGS = -O  -fPIC -g $(CFLAGS1)
CFLAGS =  -g $(CFLAGS1)
CC=/usr/local/bin/gcc
CC=gcc
ELF=true
endif
