include ../Makefile.conf


MODULES=SComponent.o SBorder.o SPanel.o \
  SFrame.o STextView.o STextEdit.o SCaret.o SEditorIF.o SEditor.o \
  STextEditLS.o SUndo.o SYuditInput.o SLayout.o SUniPrint.o \
  SSlider.o SIcon.o SOpaqueLabel.o SButton.o SLabel.o \
  STextList.o SListBox.o SIconFactory.o \
  SDialog.o STextDialog.o SFileDialog.o  \
  STextTable.o SDrawing.o SFreeHand.o \


TARGETDIR=
TARGETOBJS=

ifeq ($(SPLATFORM),WINDOWS)
OBJS=$(subst .o,.obj,$(MODULES)) $(subst .o,.obj,$(TARGETOBJS))
TARGET=swidget.lib
else
OBJS=$(MODULES) $(TARGETOBJS)
TARGET=libswidget.a
endif


all: $(TARGET)

#
# The cl drops its lib here
#
swidget.lib: $(OBJS)
	$(AR)$@ $(subst swin32/,,$(OBJS))

libswidget.a: $(OBJS)
	$(AR) $@ $(OBJS)
	$(RANLIB) $@      

%.o:%.cpp
	$(CXX) -c $(CPPFLAGS) $(subst .o,.cpp,$@)

%.obj:%.cpp
	$(CXX) -c $(CPPFLAGS) $(subst .obj,.cpp,$@)

depend:
	$(CXX) -M  $(CPPFLAGS)  $(patsubst %.o,%.cpp,$(OBJS)) > .depend

clean: 
	rm -f *.o  *.obj *.o $(TARGET)

install:

ifeq (.depend, $(wildcard .depend))
include .depend
endif
