.SUFFIXES: .o .C .c  .cpp

include mkfiles


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

include ../../sys/config/mkflags

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

CPPOBJECTS =$(CPPOBJS:%= $(OBJDIR)/%)
CCOBJECTS =$(CCOBJS:%= $(OBJDIR)/%)
CPPOBJECTS2 =$(CPPOBJS:%= $(OBJDIR2)/%)
CCOBJECTS2 =$(CCOBJS:%= $(OBJDIR2)/%)

#.c.o:
#	$(CC1) $(C++FLAGS) -c $(*F).c  -o $(OBJDIR)/$*.o
#
#.C.o:
#	$(CC) $(C++FLAGS) -c $(*F).C   -o $(OBJDIR)/$*.o
#
#.cpp.o:
#	$(CC) $(C++FLAGS) -c $(*F).cpp -o $(OBJDIR)/$*.o
#

TARGET1 = $(TARGETD)
TARGET2 = $(TARGET)

#all: $(BINDIR)/$(TARGET1) $(BINDIR)/$(TARGET2)
all: $(BINDIR)/$(TARGET2)
static:
static-debug:
debug: $(BINDIR)/$(TARGET1) 
runtime: $(BINDIR)/$(TARGET2)


$(BINDIR)/$(TARGET1): $(CPPOBJECTS) $(CCOBJECTS)
	$(CC) $(C++FLAGS) -o $(BINDIR)/$(TARGET1) $(CPPOBJECTS) $(CCOBJECTS) $(LIBSD) $(LIBM) $(EXTLIB)

$(BINDIR)/$(TARGET2): $(CPPOBJECTS2) $(CCOBJECTS2)
	$(CC) $(C++FLAGS2) -o $(BINDIR)/$(TARGET2) $(CPPOBJECTS2) $(CCOBJECTS2) $(LIBS) $(LIBM) $(EXTLIB)


$(OBJDIR)/%.o:%.cpp
	$(CC) $(C++FLAGS) -c $(*F).cpp -o $(OBJDIR)/$*.o
$(OBJDIR)/%.o:%.c
	$(CC1) $(C++FLAGS) -c $(*F).c   -o $(OBJDIR)/$*.o
$(OBJDIR2)/%.o:%.cpp
	$(CC) $(C++FLAGS2) -c $(*F).cpp -o $(OBJDIR2)/$*.o
$(OBJDIR2)/%.o:%.c
	$(CC1) $(C++FLAGS2) -c $(*F).c   -o $(OBJDIR2)/$*.o

#$(CPPOBJECTS):
#	$(CC) $(C++FLAGS) -c $(*F).cpp -o $*.o
#
#$(CCOBJECTS):
#	$(CC) $(C++FLAGS) -c $(*F).c -o $*.o


clean:
	\rm -f $(CPPOBJECTS) $(CCOBJECTS) $(CPPOBJECTS2) $(CCOBJECTS2) *.bak
	\rm -f $(BINDIR)/$(TARGET1)  $(BINDIR)/$(TARGET2)


