

##################################################################
# This is the second fixed part of the common Makefile definitions.
# The configure script will copy it to autoconf.mk.
# NOTE: COCOA_ROOT is defined as a relative path in each individual Makefile.

INC_DIRS=$(GMP_INC_DIR) $(FROBBY_INC_DIR) $(GSL_INC_DIR) $(NORMALIZ_INC_DIR) $(BOOST_INC_DIR)
INCLUDE=-I$(COCOA_ROOT)/include $(GMP_INCLUDE) $(FROBBY_INCLUDE) $(GSL_INCLUDE) $(NORMALIZ_INCLUDE) $(BOOST_INCLUDE)
COMPILE=$(CXX) $(CXXFLAGS) $(CXXFLAGS_DEFINES) $(INCLUDE)
COCOA_LIB=$(COCOA_ROOT)/lib/libcocoa.a
LIBS=$(COCOA_LIB)  $(FROBBY_LIBS)  $(GSL_LIBS)  $(NORMALIZ_LIBS)  $(GMP_LIB)  $(SOCKET_LIB)  $(BOOST_LIBS)




# Rule for compiling C++ code in *.C files into *.o object files
%.o: %.C
	@echo "Compiling `basename $@`"
	$(COMPILE) -c -o $@ $<

# Rule for compiling and linking C++ code in *.C files
%: %.C
	@echo "Compiling `basename $@`"
	$(COMPILE) -o $@ $< $(LIBS)
	@AppleDir="$@.dSYM" ; \
	echo " " $(CXXFLAGS) " " | fgrep " -g " >/dev/null; \
	if [ $$? -eq 1 -a -d "$$AppleDir" ] ; \
	then \
	  /bin/rm -rf "$$AppleDir"; \
	fi


# The following are derived from the conventions for Makefiles for code
# which should become part of the GNU project.  It seems reasonable to
# adopt them here as well.  I found the recommendations in the online
# help for make (e.g. run the command "info make" on a GNU/Linux system).
SHELL=/bin/bash
.SUFFIXES:
.SUFFIXES: .C .o
