#
# make compatibility
#
SHELL = /bin/sh

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .o .d
# 
# Source and Installation Paths
#
prefix  =      @prefix@
exec_prefix =  @exec_prefix@
srcdir =       @srcdir@
VPATH =        @srcdir@
#
# Installation directories for binaries and manual pages
#
bindir   =     @bindir@
sharedir =     @datadir@
mandir   =     @mandir@
man1dir  =     $(mandir)/man1
#
# install program
#
INSTALL =               @INSTALL@
INSTALL_PROGRAM =       ${INSTALL}
INSTALL_DATA =          ${INSTALL} -m 644
#
# Program version
#
VERSION = @cdrdao_version@
#
# compiler and library stuff
#
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@ 
ALL_CXXFLAGS = @DEFS@ @mydefs@ -DVERSION=\"$(VERSION)\" -DDRIVER_TABLE_FILE=\"$(DRIVER_TABLE_FILE)\" -I$(srcdir)/.. -I$(srcdir) -I$(srcdir)/../trackdb $(CXXFLAGS)
LDFLAGS = 
ALL_LDFLAGS = @LDFLAGS@ $(LDFLAGS)
LIBS = @LIBS@
RANLIB = @RANLIB@
AR = ar
#
#
#
SRC = toc2cue.cc

DEP = $(SRC:%.cc=%.d)

#
#
#
all: toc2cue

install: all 

installdirs:
	$(srcdir)/../mkinstalldirs $(bindir)
	$(srcdir)/../mkinstalldirs $(man1dir)
	$(srcdir)/../mkinstalldirs $(CDRDAO_DATA_DIR)

clean:
	rm -f *.o toc2cue

distclean: clean
	rm -f Makefile
	rm -f *.d
#
#
#
toc2cue: toc2cue.o $(srcdir)/../trackdb/libtrackdb.a
	$(CXX) $(ALL_LDFLAGS) -o toc2cue toc2cue.o -L$(srcdir)/../trackdb -ltrackdb -L$(srcdir)/../edc_ecc -ledc_ecc $(LIBS)


#
#
#
%.o : %.cc
	$(CXX) $(ALL_CXXFLAGS) -c $< -o $@

%.d : %.cc
	@echo Creating dependencies for $<
	@$(CXX) -M $(ALL_CXXFLAGS) -c $< > $@
#
#
#

include $(DEP)
