
NOT_SRCS := 
SRCS    := $(filter-out $(NOT_SRCS), $(wildcard *.cc))
SRCS    := ${SRCS} utility/src/ArgumentList.cc utility/src/DirIterator.cc \
           utility/src/Storage.cc gfx/src/X11Helper.cc gfx/src/EvasHelper.cc

OBJS := $(addsuffix .o, $(basename $(SRCS)))
DEPS := $(addsuffix .d, $(basename $(SRCS)))

SUBDIRS := themes
PROGS := macosd
all: $(SUBDIRS) $(PROGS)

include ./config.make
include ./Rules

INCLUDES := -I. -I utility/include -I utility/include/template -I gfx/include ${EVASINCS} ${PBBINCS}
LIBS := $(PBBLIBS)

CXXFLAGS	:= -g  $(INCLUDES)

###

objects = utility/src/DirIterator.o utility/src/Storage.o \
          utility/src/ArgumentList.o PBB.o Main.o

ifneq "$(WITHEVAS)" "0"
  objects += gfx/src/X11Helper.o gfx/src/EvasHelper.o PBBEvas.o
  INCLUDES += $(EVASINCS) -DDATADIR=\"$(datadir)\"
  LIBS += $(EVASLIBS)
endif

ifneq "$(WITHXOSD)" "0"
  objects += PBBXosd.o
  INCLUDES += $(XOSDINCS)
  LIBS += $(XOSDLIBS)
endif

macosd:	$(objects)
	@echo '  LINK EXEC $@'
	$(Q)$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)

-include $(DEPS)

install: $(PROGS) $(SUBDIRS)
	@cp -v macosd $(bindir)/

clean:
	rm -vf $(objects) $(PROGS)
	rm -vf *~ *.d
	rm -vf conftest.* config.{tmp,log}

dist-clean:
	rm -vf config.{h,make}

