BASE = /usr/local/dx

include /usr/local/dx/lib_/arch.mak

# include ../../.mak

EXP      = $(BASE)/lib_/dxexec.exp
CFLAGS = -g -D -I$(BASE)/include \
	$(DXCFLAGS)

CC = $(DXCC)
	
LIBS       = -L$(BASE)/lib_ -lDX \
			-lGL \
	            $(DXEXECLINKLIBS)

.c.o: ; $(CC) -c $*.c $(DXABI) $(DX_RTL_CFLAGS) $(CFLAGS)

# try successively to make the loadable interactors various ways, as a last resort relink the exec with the interactors statically bound

myinteractors: myinteractors.o
	-rm myinteractors
	$(MAKE) -f interactors_make loadable_interactors || $(MAKE) -f interactors_make loadable_aix_interactors || $(MAKE) -f unrtloadable_dxexec
	
loadable_interactors:
	$(CCLD) $(DXABI) $(DX_RTL_LDFLAGS) -e DXEntry \
		-o myinteractors myinteractors.o -lm

loadable_aix_interactors:
	$(CC) -o myinteractors myinteractors.o -e DXEntry -bI:$(EXP) -lm

unrtloadable_dxexec: interactors.o
		$(CCLD) $(DXABI) $(LDLIBFLAGS) myinteractors.o $(LIBS) -o dxexec

