# =========================================================================
#     This makefile was generated by
#     Bakefile 0.1.9 (http://bakefile.sourceforge.net)
#     Do not modify, all changes will be overwritten!
# =========================================================================



# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------

# 'install' program location 
INSTALL = install

# Location where the package is installed by 'make install' 
prefix = /usr/local

# C++ compiler 
CXX = g++

# Standard flags for C++ 
CXXFLAGS = 

# Standard preprocessor flags (common for CC and CXX) 
CPPFLAGS = 

# Standard linker flags 
LDFLAGS = 

# Type of compiled binaries. [debug,release]
BUILD = release



# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------

### Variables: ###

CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD
XCAS_CXXFLAGS = $(__WARNINGS_0) $(__OPTIMIZEFLAG_1) $(__DEBUGINFO) -Iinclude \
	-Isrc -I/usr/include/giac `fltk-config --use-images --cxxflags` \
	-DHAVE_LIBFLTK $(CPPFLAGS) $(CXXFLAGS)
XCAS_OBJECTS =  \
	xcas_plotfltk.o \
	xcas_Eqw.o \
	xcas_sheet.o \
	xcas_xcas.o

### Conditionally set variables: ###

ifeq ($(BUILD),debug)
__WARNINGS_0 = -W -Wall
endif
ifeq ($(BUILD),release)
__WARNINGS_0 = 
endif
ifeq ($(BUILD),debug)
__OPTIMIZEFLAG_1 = -O0
endif
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_1 = -O2
endif
ifeq ($(BUILD),debug)
__DEBUGINFO = -g
endif
ifeq ($(BUILD),release)
__DEBUGINFO = 
endif


### Targets: ###

all: xcas

install: all install_xcas

uninstall: 

clean: 
	rm -f ./*.o
	rm -f ./*.d
	rm -f xcas

xcas: $(XCAS_OBJECTS)
	$(CXX) -o $@ $(XCAS_OBJECTS) $(LDFLAGS) $(__DEBUGINFO)  `fltk-config --use-images --ldflags`  -lgiac -lX11 -lXft

install_xcas: 
	$(INSTALL) -d $(prefix)/bin
	install -c xcas $(prefix)/bin

xcas_plotfltk.o: ./src/plotfltk.cc
	$(CXX) -c -o $@ $(XCAS_CXXFLAGS) $(CPPDEPS) $<

xcas_Eqw.o: ./src/Eqw.cc
	$(CXX) -c -o $@ $(XCAS_CXXFLAGS) $(CPPDEPS) $<

xcas_sheet.o: ./src/sheet.cc
	$(CXX) -c -o $@ $(XCAS_CXXFLAGS) $(CPPDEPS) $<

xcas_xcas.o: ./src/xcas.cxx
	$(CXX) -c -o $@ $(XCAS_CXXFLAGS) $(CPPDEPS) $<

.PHONY: all install uninstall clean install_xcas


# Dependencies tracking:
-include ./*.d
