.SUFFIXES: .o .C .c  .cpp


############################################################

include mkflags
include mk.inf

############################################################

C++FLAGS = $(DEBUG) $(ARCH)

.c.o:
	$(CC1) $(ALL_INCLUDES) $(C++FLAGS) -c $(*F).c  -o $*.o
	ar ruv $(TARGET2) $*.o

.C.o:
	$(CC) $(ALL_INCLUDES) $(C++FLAGS) -c $(*F).C   -o $*.o
	ar ruv $(TARGET2) $*.o

.cpp.o:
	$(CC) $(ALL_INCLUDES) $(C++FLAGS) -c $(*F).cpp -o $*.o
	ar ruv $(TARGET2) $*.o


all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(C++FLAGS) -r -keep_private_externs -nostdlib -o master_obj.o  $(OBJS)
	$(CC) $(C++FLAGS) -o $(TARGET) $(SHARED) master_obj.o $(ALL_LIBS)
	$(CC) $(C++FLAGS) -o $(TARGET).bundle -bundle -undefined suppress -flat_namespace master_obj.o $(ALL_LIBS)
	$(RANLIB) $(TARGET2)

clean:
	\rm -f $(TARGET) $(TARGET2) *.o log.txt $(TARGET).bundle


