include ../env

# Change the following lines to match the values on your system
#XERCESJAR=/usr/java/xerces-1_4_4/xerces.jar
#JAVADIR=/usr/java/jdk1.3.1
#SNIADIRLIB=/usr/sniacimom/lib
#SNIADIREXT=/usr/sniacimom/lib/ext
#SNIADIRINC=/usr/sniacimom/include

# Changes shouldn't be necessary below this line
ifdef SNIA
CFLAGS=-Wall -D_COMPILE_UNIX -g -I. -I$(SNIADIRINC)
LDFLAGS= -shared -ldl -lpthread -L$(LIBINSTALL) -lCMPIOpenCimom 
endif

ifdef PEGASUS
CFLAGS=-Wall -D_COMPILE_UNIX -g -I. -I./parser -I$(CIMOMINC)
LDFLAGS= -shared -ldl -lpthread -L ./parser -L$(LIBINSTALL)
endif

ifdef STANDALONE
CFLAGS=-Wall -D_COMPILE_UNIX -fPIC -g -I. -I./parser -I$(CIMOMINC)
LDFLAGS= -shared -fPIC -ldl -lpthread -L ./parser -L$(CIMOMLIB)
endif

#Targets
SUBDIRS=
LIBSOURCES=parseelareport.c
LIBTARGETS=libparseelareport.so

.PHONY: all install uninstall clean

lib%.so: %.o
	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@

all: $(SUBDIRS) $(LIBTARGETS)

install: $(SUBDIRS) $(LIBTARGETS)
	 install -m 755 $(LIBTARGETS) $(COMMONLIB)

uninstall: $(SUBDIRS) 
	   cd $(LIBINSTALL) && $(RM) $(LIBTARGETS)

clean:
	$(RM) *.so *.o 
