BASEDIR := ./
+BINEXT :=
+OBJEXT := .o
+LIBEXT := .a
+
CXXFLAGS :=
LDFLAGS := -lfltk
# each module will add to this, .os are derived from it
+TARGETLIBS :=
+TARGETBINS :=
+LIBS :=
+LIBSRC :=
SRC :=
-include module.mk
-include gui/module.mk
+all: targets
+include gui/module.mk
+include module.mk
# process what the module.mks defined
OBJ := $(patsubst %.cxx,%.o, $(filter %.cxx,$(SRC)))
DEPS := $(OBJ:.o=.d)
-mussa: $(OBJ)
- g++ -o $@ $(CXXFLAGS) $(LDFLAGS) $^
+targets: $(TARGETLIBS) $(TARGETBINS)
+
+#mussa: $(OBJ)
+# g++ -o $@ $(CXXFLAGS) $(LDFLAGS) $^
%.d: %.cxx
makedepend -o.d $(dirname $^) $(CFLAGS) $(CXXFILAGS) $^ -f- > $@
SetupWindow.cxx \
SubAnalysisWindow.cxx
-SRC += $(addprefix $(CURDIR), $(SOURCES.cxx))
+MUSSA_FLTK_SRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
+
+SRC += $(MUSSA_FLTK_SRC)
CXXFLAGS += -I$(CURDIR)
+MUSSA_FLTK_LIB := $(CURDIR)libmussa_fltk$(LIBEXT)
+LIBDIRS += -L$(CURDIR)
+
+TARGETLIBS += $(MUSSA_FLTK_LIB)
+
+$(MUSSA_FLTK_LIB): $(MUSSA_FLTK_SRC:.cxx=$(OBJEXT))
+ $(AR) rv $@ $?
+ #g++ -static -lfltk -o $@ $?
+ #$(call bless_library,$@)
+
#seqcomp.cxx \ #(old seqcomp)
#mussa_nway_refine.cxx \ (broken code)
-SRC += $(addprefix $(CURDIR), $(SOURCES.cxx))
+MUSSASRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
+
+SRC += $(MUSSASRC)
CXXFLAGS += -I$(CURDIR)
+MUSSA := $(CURDIR)/mussa$(BINEXT)
+TARGETBINS += $(MUSSA)
+
+$(MUSSA): $(MUSSASRC:.cxx=$(OBJEXT)) $(MUSSA_FLTK_LIB)
+ g++ -lfltk -o $@ $(MUSSASRC:.cxx=$(OBJEXT)) $(MUSSA_FLTK_LIB)
+