COLLECT = ar cru RANLIB = ranlib LNK = ln -s POST = $(fltkconfig) --post RPMARCH = `rpmbuild --showrc | awk '/^build arch/ {print $$4}'` MSGCAT = msgcat MSGFMT = msgfmt -c --statistics docdir = $(datadir)/doc/$(TARGET) SRCDIR = $(src_dir) BUILDDIR = $(build_dir)/ MAN1 = MAN3 = DOKU = AUTHORS \ ChangeLog \ COPYING \ README MIME_TYPES = ICONS = DEFAULT_PROFILES = printing default_profiles = default_profiles CONFIG_FILES = \ $(SRCDIR)/configure \ $(SRCDIR)/configure_tests.sh \ $(SRCDIR)/makefile.in \ $(SRCDIR)/$(TARGET).spec.in \ $(SRCDIR)/$(TARGET)_control.in ALL_FILES = \ $(DOKU) \ $(ICONS) \ $(MIME_TYPES) \ $(MAN1) $(MAN3) # build all what is needed to run the libraries, helpers all: test -d $(default_profiles) && \ ( cd $(default_profiles); \ for prof in $(DEFAULT_PROFILES); do \ test -d $${prof} && \ echo "$${prof} profiles will be included" || \ echo "$${prof} profile directory is not found - ignoring"; \ done; ) || echo "$(default_profiles) directory is not found - ignoring" echo ... $@ done # get time stamp MTIME := $(shell date +%y%m%d.%H%M%S) # this is a test time: echo $(MTIME) # install recursive install: install-main install-icc echo ... $@ done install-main: install-icc: install_profiles install_profiles: test -d $(default_profiles) && \ ( cd $(default_profiles); \ for prof in $(DEFAULT_PROFILES); do \ test -d $${prof} && \ (cd $${prof}; $(MAKE) DESTDIR="$(DESTDIR)" SYSCOLORDIR=$(syscolordir) ICCDIRNAME=$(iccdirname) install) || \ echo "$${prof} profile directory is not found - ignoring"; \ done; ) || echo "$(default_profiles) directory is not found - ignoring" # build a source distribution package dist: targz test -d ../Archiv && mv -v ../Archiv/$(TARGET)-$(MTIME).tgz $(TARGET)-$(VERSION).tar.gz || mv -v $(TARGET)-$(MTIME).tgz $(TARGET)-$(VERSION).tar.gz tar xzf $(TARGET)-$(VERSION).tar.gz tar cjf $(TARGET)-$(VERSION).tar.bz2 $(TARGET)-$(VERSION)/ $(RM) -R $(TARGET)-$(VERSION) dist-gzip: dist # build a binary rpm package rpm: dist $(SRCDIR)/configure --prefix=/usr --rpm-only # generate the spec file mkdir -p rpmdir/BUILD \ rpmdir/SPECS \ rpmdir/SOURCES \ rpmdir/SRPMS $(COPY) -f $(TARGET)-$(VERSION).tar.bz2 rpmdir/SOURCES rpmbuild --clean -ba $(build_dir)/$(TARGET).spec --define "_topdir $$PWD/rpmdir" @echo "============================================================" @echo "Finished - the packages are in rpmdir/RPMS and rpmdir/SRPMS!" deb: dist $(SRCDIR)/configure --prefix=/usr --rpm-only mkdir -p debian/deb/DEBIAN tar xvzf $(TARGET)-$(VERSION).tar.gz (cd $(TARGET)-$(VERSION); \ ./configure --prefix=/usr; \ make DESTDIR=$(build_dir)/debian/deb/DEBIAN install;) $(COPY) $(TARGET)-$(VERSION)/$(TARGET)_control $(build_dir)/debian/deb/DEBIAN/control $(RM) -R $(TARGET)-$(VERSION) dpkg -b $(build_dir)/debian/deb debian/$(TARGET)_$(VERSION)-$(RELEASE)_$(deb_arch).deb $(RM) -R $(build_dir)/debian/deb echo ... $@ done # remove everything previously installed uninstall: uninstall-icc uninstall_profiles: echo Uninstalling profiles ... test -d $(default_profiles) && \ ( cd $(default_profiles); \ for prof in $(DEFAULT_PROFILES); do \ test -d $${prof} && \ (cd $${prof}; $(MAKE) DESTDIR="$(DESTDIR)" SYSCOLORDIR=$(syscolordir) ICCDIRNAME=$(iccdirname) uninstall) || \ echo "$${prof} profile directory is not found - ignoring"; \ done; \ ) || echo "no profile directory found" echo ... done uninstalling profiles uninstall-icc: uninstall_profiles # remove in this directory distclean: clean -$(RM) Makefile -$(RM) $(default_profiles)/printing/Makefile -$(RM) $(TARGET).spec $(TARGET)-icc.spec clean: echo ... $@ done # smallest package covering the current directory tgz: -test -d Entwickeln && $(RM) -r Entwickeln $(MAKE) DESTDIR=Entwickeln copy_files tar cf - Entwickeln/ \ | gzip > $(TARGET)_$(MTIME).tgz -test -d ../Archiv && mv -v $(TARGET)_*.tgz ../Archiv -test -d Entwickeln && \ test `pwd` != `(cd Entwickeln; pwd)` && \ rm -R Entwickeln # build the source package including the subdirectories targz: test -d $(TARGET)-$(VERSION) && $(RM) -R $(TARGET)-$(VERSION) || echo -e "\c" $(MAKE) DESTDIR=$(build_dir)/$(TARGET)-$(VERSION) copy_files cd $(default_profiles); \ for prof in $(DEFAULT_PROFILES); do \ test -d $${prof} && \ mkdir -p ../$(TARGET)-$(VERSION)/$(default_profiles)/$${prof}; \ (cd $${prof}; echo bin in `pwd`; $(MAKE) DESTDIR=$(build_dir)/$(TARGET)-$(VERSION)/$(default_profiles)/$${prof} copy_files; $(RM) $(build_dir)/$(TARGET)-$(VERSION)/$(default_profiles)/$${prof}/Makefile) || \ echo "$${prof} profile directory is not found - ignoring"; \ done; tar cf - $(TARGET)-$(VERSION)/ \ | gzip > $(build_dir)/$(TARGET)-$(MTIME).tgz test -d $(build_dir)/$(TARGET)-$(VERSION) && \ test `pwd` != `(cd $(build_dir)/$(TARGET)-$(VERSION); pwd)` && \ $(RM) -R $(build_dir)/$(TARGET)-$(VERSION) test -d ../Archiv && mv -v $(TARGET)-*.tgz ../Archiv || echo "no copy" # basic file set copy_files: mkdir $(DESTDIR) cd $(SRCDIR) && \ $(COPY) -R $(ALL_FILES) $(DESTDIR) $(COPY) $(CONFIG_FILES) $(DESTDIR) echo ... $@ done help: echo "... all : build the binaries" echo "... " echo "... install : install the binaries, include files and data" echo "... install-icc: install only profiles and targets" echo "... uninstall" echo "... clean : remove binaries, object files and most processed data" echo "... distclean : remove all files processed from configure scripts" echo "... rpm : build RPM's" echo "... dist : build a distribution tarball and place local" echo "... targz : build a distribution tar ball" echo "... tgz : build a development tar ball" echo "... copy_files : copy distribution files to a DESTDIR=xxx path" echo " VARIABLES:" echo "... DESTDIR=\"/user/a/My Install Dir/\" install" echo "... BUILDDIR=../build_local"