#
# Makefile for RS6000 Imp                               23/09/92
#
# Command line macro LICENCE can be used to make either an unrestricted
# or a restricted (time-bombed) compiler
#     'make LICENCE=unrestricted'  is the same as  'make'  and will
#     create an unrestricted compiler
#
#     'make LICENCE=restricted'  will make a time-bombed compiler which 
#     must be distributed with an appropriate siteid and product code
#
# REMEMBER TO CHANGE ENTRY IN OBJLIST *AND* DEPENDENCY LIST WHENEVER
# A NEW SOURCE IS CHANGED
#
#   Note: MAXWORK,MAXDICT is the default for the m88k IMP compiler




# Directory Structure
compiler = .
src  = ../isrce
tgt  = .

# use opus as to generate 88 OCS conformant code

# CONFORMTOOLS = $(HOME)/bin/opus.dev
# CONFORMFLAGS = -B$(CONFORMTOOLS)/ -fwritable-strings


# names of double include files
include Incnames

# Object Lists
IOBJS = \
       $(src)/rs6p104.o\
       $(src)/rs6p206.1.o\
       $(src)/rs6p304.o\
       $(src)/rs6p422.o\
	$(src)/ftncomp65.5c.o \
       $(src)/cserv.o\
       $(tgt)/celfput17.6.o\
       $(tgt)/cprocs08.2.o\
       $(tgt)/eprocs15.1.o\
       $(tgt)/mprocs18.1.o\
       $(tgt)/bprocs20.o\
       $(tgt)/p5procs06.5.2.o\
       $(tgt)/p5rprocs4.o\
       $(tgt)/p5code05.6.o\
	$(tgt)/impsup.o \
	$(tgt)/dum.o
       

COBJS =\

AOBJS = \


OBJS = $(IOBJS)\
       $(COBJS)\
       $(AOBJS)

check =  -P nocheck,map,maxwork,maxdict
trace =  -P nocheck,noarray,map,maxwork,maxdict
notrace  =  -O -P map,maxwork,maxdict
IFLAGS =  $(check)

# need to make new rules for .i .o because they are not predefined
# need to move new object back to home directory 
# so that make will find it up to date next time

.SUFFIXES: .i .o .c .s


.i.o:
	
	p5imp -c -w $(IFLAGS) $*.i 

#	mv $(@F) $(<D)

.c.o:
	gcc -c $*.c

#	mv $(@F) $(<D)
.s.o:
	cc  -c -O $*.s

#	mv $(@F) $(<D)






# Compiler target

epcf77compiler: $(IOBJS)
	ld -r -o testcompiler.o $(IOBJS) ../implib/bmove.o 
	ls -l testcompiler.o
	gcc -o testcompiler testcompiler.o $(src)/getstat1.o ../libimp2.a
	ls -l testcompiler

##cc -o epcf77compiler $(OBJS) -lIMP
#
#
## Move compiler to appropriate directory (specify RELEASEDIR=xx on make command)
#
#release:
#	ls -l epcf77compiler
#strip $(RELEASEDIR)/epcf77compiler
#ls -l $(RELEASEDIR)/epcf77compiler



#dependencies



$(tgt)/cprocs08.2.o:	$(tgt)/cprocs08.2.c $(cgtarget) $(cgconsts) $(ecodes) \
				  $(protos) $(boconsts) $(archdefs) $(archregs) $(archcode) $(archrvars)

$(tgt)/eprocs15.1.o:	$(tgt)/eprocs15.1.c $(cgtarget) $(ecodes) $(enames) \
					  $(boconsts) $(protos) $(cgconsts)

$(tgt)/mprocs18.1.o:	$(tgt)/mprocs18.1.c $(cgtarget) $(cgconsts) $(archdefs) $(spnames)

$(tgt)/p5procs06.5.2.o:	$(tgt)/p5procs06.5.2.c $(cgtarget) $(cgconsts) $(archdefs)\
                          $(protos) $(boconsts) $(archrvars)

$(tgt)/celfput17.6.o:	$(tgt)/celfput17.6.c $(elfconsts) $(protos)

$(tgt)/bprocs20.o:      $(tgt)/bprocs20.c $(cgtarget) $(archsched) $(archdefs) \
                       $(protos) $(boconsts)

$(tgt)/p5rprocs4.o:      $(tgt)/p5rprocs4.c $(cgtarget) $(cgconsts) $(archdefs) \
                       $(protos) $(boconsts) $(archrvars)

$(tgt)/p5code05.6.o:      $(tgt)/p5code05.6.c $(cgtarget) $(cgconsts) $(archdefs) \
                       $(protos) $(boconsts)

$(src)/ftncomp65.5c.o:	$(src)/ftncomp65.5c.i $(ftnht) $(fiocnsts) $(fiopars)\
			$(fstatfmt) $(vers)

$(src)/cserv.o:		$(src)/cserv.i	


