# Makefile for libWindow (Linux)
# ==============================

# directory where you install this library
INFO1HOME = /afs/ethz.ch/users/k/kusterth/homepage/html/informatik/libwindow-1.16

# The compiler
CXX      = g++

# flag for runtime libraries
RUNTIME_LDFLAG = -Wl,-R 

# flag to create shared libraries
SHAREDLIBFLAG = -shared

# X11HOME 
X11HOME = /usr/X11R6

# include path
IPATH = -I${INFO1HOME}/include -I${X11HOME}/include

# lib path
LDPATH = -L${INFO1HOME}/lib ${RUNTIME_LDFLAG}${INFO1HOME}/lib -L${X11HOME}/lib ${RUNTIME_LDFLAG}${X11HOME}/lib

# We rather leave out -O2 here, since with egcs-1.0 there are
# some serious problems when optimizing
CXXFLAGS    = ${IPATH} -Wall

# Libraries
LIBS      = ${LDPATH} -lwindow -lX11 -lm

# make targets
libwindow:
	${CXX} -fpic -I. ${CXXFLAGS} -c window.C
	${CXX} ${SHAREDLIBFLAG} window.o -o libwindow.so 
	mv libwindow.so lib

%: %.C
	${CXX} ${CXXFLAGS} -o $* $*.C ${LIBS} 

# make the current directory clean (remove object files)
clean:
	rm *.o
