srcdir = @srcdir@ top_srcdir = @top_srcdir@ # Where does the installation go ? PREFIX=@prefix@ DESTDIR=@DESTDIR@ LIBSUBDIR=@LIBSUBDIR@ BINDIR=$(DESTDIR)$(PREFIX)/bin LIBDIR=$(DESTDIR)$(PREFIX)/$(LIBSUBDIR) INCLUDEDIR=$(DESTDIR)$(PREFIX)/include # filename conventions EXE=@EXEEXT@ OBJ=@OBJEXT@ # compilers used. LIBPFX=@LIBPFX@ LIBEXT=@LIBEXT@ CC = @CC@ CXX = @CXX@ LD = @CXX@ RC = @RC@ all: Makefile build-dep Makefile: $(srcdir)/Makefile.in echo "Updating out-of date Makefiles..." ../reconfigure.sh build-dep: make dep=yes build # # Linux build only. # ifeq ($(RC),) # add -I.. in order to find config.h CFLAGS = \ @CFLAGS@ @DEFS@ @XML_CFLAGS@ @MYSQL_CFLAGS@ -I.. -I$(srcdir) -I$(top_srcdir)/fancylog -I$(top_srcdir)/fancybase CXXFLAGS = \ @CXXFLAGS@ @DEFS@ @XML_CFLAGS@ @MYSQL_CFLAGS@ -I.. -I$(srcdir) -I$(top_srcdir)/fancylog -I$(top_srcdir)/fancybase LDFLAGS = @LDFLAGS@ #libraries, which are in the same source tree. BASELIBRARIES= %.depend: $(srcdir)/%.c $(CC) $(CFLAGS) -M $< -o $@ %.depend: $(srcdir)/%.cpp $(CXX) $(CXXFLAGS) -M $< -o $@ %.$(OBJ): $(srcdir)/%.c $(CC) $(CFLAGS) -c $< -o $@ %.$(OBJ): $(srcdir)/%.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ LIBRARY = $(LIBPFX)fancymysql.$(LIBEXT) HEADERS=fancymysql.h fancymysqllog.h fancymysqlexception.h build: $(LIBRARY) clean:: rm -f *.depend *.$(OBJ) *~ *.bak .*~ .*.bak core $(LIBRARY) # dummy target for xrefs foo: # # objects # COMMONOBJECTS = fancymysql.$(OBJ) fancymysqllog.$(OBJ) fancymysqlexception.$(OBJ) ALLOBJECTS=$(COMMONOBJECTS) $(LIBRARY): $(ALLOBJECTS) rm -f $@ $(AR) $(ARFLAGS) $@ $(ALLOBJECTS) install: all if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR); fi cp $(LIBRARY) $(LIBDIR) cd $(LIBDIR); chmod 644 $(LIBRARY) if [ ! -d $(INCLUDEDIR) ] ; then mkdir $(INCLUDEDIR); fi for file in $(HEADERS); do cmp -s $(srcdir)/$$file $(INCLUDEDIR)/$$file || cp -p $(srcdir)/$$file $(INCLUDEDIR)/$$file; done cd $(INCLUDEDIR); chmod 644 $(HEADERS) # # dependencies # ifeq ($(dep),yes) include $(addsuffix .depend, $(basename $(ALLOBJECTS))) endif else # dummy win32 build build: clean: install: endif distclean:: clean rm -f Makefile