include ../VERSION

# Linux
INCSDIR     =
LIBSDIR     = -L/usr/X11R6/lib
# overriden by upper makefile
LIBDIR=../lib
ETCDIR=../lib

SHAPEDEF = -DSHAPE
SHAPELIB = -lXext

DEBUG    = -DDEBUG

# executable extenstion
EXEEXT=

DEFINES     = \
	$(SHAPEDEF) $(DEBUG) $(OS2)\
	-DLIBPATH='"$(LIBDIR)"' \
	-DETCPATH='"$(ETCDIR)"' \
	-DVERSION='"$(VERSION)"'

#OPTIMIZE    = -g
OPTIMIZE   = -O -g
#OPTIMIZE   = -O -g -pg
#OPTIMIE     = -O -s
#OPTIMIZE   = -O2 -s

LIBS        = -lXpm $(SHAPELIB) -lX11

WARN        = -pedantic -Wall -Wpointer-arith \
              -Wconversion -Wwrite-strings \
              -Wmissing-prototypes -Wmissing-declarations \
              -Winline

CXX         = g++
LD          = gcc 
CXXOPTS     = -pipe $(WARN)
CXXFLAGS    = $(OPTIMIZE) $(CXXOPTS) $(DEFINES) $(INCSDIR)
LFLAGS      = $(OPTIMIZE) $(LIBSDIR)

PROGRAMS = icewm$(EXEEXT) #icesound$(EXEEXT)

OBJS    = icewm.o misc.o option.o \
	scrollbar.o dialogs.o winlist.o mailbox.o \
	window.o root.o frame.o title.o button.o client.o menu.o \
        status.o switch.o movesize.o taskbar.o decorate.o \
        graphics.o icons.o

ICESOUNDOBJS = icesound.o misc.o 

.SUFFIXES:
.SUFFIXES: .cc .o .h

.cc.o:
	$(CXX) $(CXXFLAGS) -c $<

all: $(PROGRAMS)

clean:
	rm -f $(PROGRAMS) *.o *~ 

icewm$(EXEEXT): $(OBJS)
	$(LD) -o icewm$(EXEEXT) $(LFLAGS) $(OBJS) $(LIBS)

icesound$(EXEEXT): $(ICESOUNDOBJS)
	$(LD) -o icesound$(EXEEXT) $(LFLAGS) $(ICESOUNDOBJS) $(LIBS)

depend:
	gccmakedep *.cc

# DO NOT DELETE
button.o: button.cc icewm.h config.h MwmUtil.h default.h guievent.h

client.o: client.cc icewm.h config.h MwmUtil.h default.h guievent.h

decorate.o: decorate.cc icewm.h config.h MwmUtil.h default.h guievent.h

frame.o: frame.cc icewm.h config.h MwmUtil.h default.h guievent.h

graphics.o: graphics.cc icewm.h config.h MwmUtil.h default.h guievent.h

icesound.o: icesound.cc guievent.h

icewm.o: icewm.cc icewm.h config.h MwmUtil.h default.h guievent.h

icons.o: icons.cc icewm.h config.h MwmUtil.h default.h guievent.h

mailbox.o: mailbox.cc icewm.h config.h MwmUtil.h default.h guievent.h

menu.o: menu.cc icewm.h config.h MwmUtil.h default.h guievent.h

misc.o: misc.cc icewm.h config.h MwmUtil.h default.h guievent.h

movesize.o: movesize.cc icewm.h config.h MwmUtil.h  default.h guievent.h

option.o: option.cc icewm.h config.h MwmUtil.h default.h guievent.h

root.o: root.cc icewm.h config.h MwmUtil.h default.h guievent.h

status.o: status.cc icewm.h config.h MwmUtil.h default.h guievent.h

switch.o: switch.cc icewm.h config.h MwmUtil.h default.h guievent.h

taskbar.o: taskbar.cc icewm.h config.h MwmUtil.h default.h guievent.h

title.o: title.cc icewm.h config.h MwmUtil.h default.h guievent.h

window.o: window.cc icewm.h config.h MwmUtil.h default.h guievent.h

winlist.o: winlist.cc icewm.h config.h MwmUtil.h default.h guievent.h

dialogs.o: dialogs.cc icewm.h config.h MwmUtil.h default.h guievent.h

scrollbar.o: scrollbar.cc icewm.h config.h MwmUtil.h default.h guievent.h

