
#----------------------------------------------------------------
BINDIR=$(PREFIX)/bin
LIBDIR=$(PREFIX)/lib/xcdroast-0.96d
MANDIR=$(PREFIX)/man
INSTALL=/usr/bin/install -c

install:
	$(INSTALL) -m 0755 -d $(RPM_BUILD_ROOT)/$(BINDIR) $(RPM_BUILD_ROOT)/$(PREFIX)/lib $(RPM_BUILD_ROOT)/$(MANDIR) $(RPM_BUILD_ROOT)/$(MANDIR)/man1
	$(INSTALL) -m 0755 ./xcdroast $(RPM_BUILD_ROOT)/$(BINDIR) 
	$(INSTALL) -m 0755 -d $(RPM_BUILD_ROOT)/$(LIBDIR)/bin $(RPM_BUILD_ROOT)/$(LIBDIR)/logo $(RPM_BUILD_ROOT)/$(LIBDIR)/sound
	$(INSTALL) -m 0755 ./lib/bin/isodetect $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/isoinfo $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/isosize $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/cdrecord-1.6 $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/mycmp $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/mydd $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/mymkisofs-1.12b3 $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/playcdda $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0755 ./lib/bin/readcdda $(RPM_BUILD_ROOT)/$(LIBDIR)/bin
	$(INSTALL) -m 0644 ./lib/logo/xcdricon.xbm $(RPM_BUILD_ROOT)/$(LIBDIR)/logo
	$(INSTALL) -m 0644 ./lib/logo/xcdricon.xpm $(RPM_BUILD_ROOT)/$(LIBDIR)/logo
	$(INSTALL) -m 0644 ./lib/logo/xcdrmini.xpm $(RPM_BUILD_ROOT)/$(LIBDIR)/logo
	$(INSTALL) -m 0644 ./lib/logo/xcdrlogo.gif $(RPM_BUILD_ROOT)/$(LIBDIR)/logo
	$(INSTALL) -m 0644 ./lib/sound/test.cdr $(RPM_BUILD_ROOT)/$(LIBDIR)/sound
	$(INSTALL) -m 0644 ./xcdroast.1 $(RPM_BUILD_ROOT)/$(MANDIR)/man1
 
deinstall:
	rm -f $(BINDIR)/xcdroast
	rm -rf $(LIBDIR)
	rm -f $(MANDIR)/man1/xcdroast.1

utils:
	cd src/utils; make; make install

xcdroast-shared: src/etixwish/Makefile
	cd src/etixwish; make xcdroast-shared; make install

xcdroast-static: src/etixwish/Makefile
	cd src/etixwish; make xcdroast-static; make install

src/etixwish/Makefile:
	@echo "Makefile not found. Run \"./configure\" first."
	@exit 1

clean:
	rm -f lib/bin/*
	rm -f src/etixwish/Makefile
	rm -f xcdroast
	cd src/etixwish; make -f Makefile.in clean
	cd src/utils; make clean
	rm -f Makefile
