PACKAGE=drakpxelinux VERSION:=$(shell rpm -q --qf %{VERSION} --specfile $(PACKAGE).spec) RELEASE:=$(shell rpm -q --qf %{RELEASE} --specfile $(PACKAGE).spec) TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') RPMOPT = --clean --rmspec #SUBDIRS = po localedir = $(prefix)/usr/share/locale override CFLAGS += -DPACKAGE=\"$(PACKAGE\" -DLOCALEDIR=\"$(localedir)\" all: drakpxelinux.pl # for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done clean: $(MAKE) -C po $@ rm -f core .#*[0-9] rm -rf *~ # for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done install: all $(MAKE) -C po $@ install -d $(RPM_BUILD_ROOT)/usr/{bin/,share/drakpxelinux/} install -s -m755 $(PACKAGE).pl $(RPM_BUILD_ROOT)/usr/bin/drakpxelinux # for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done # rules to build a test rpm localrpm: localdist buildrpm localdist: cleandist dir localcopy tar cleandist: rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 dir: mkdir $(PACKAGE)-$(VERSION) localcopy: find . -not -name "$(PACKAGE)-$(VERSION)"|cpio -pd $(PACKAGE)-$(VERSION)/ find $(PACKAGE)-$(VERSION) -type d -name CVS -o -name .cvsignore |xargs rm -rf tar: tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) bzip2 -9vf $(PACKAGE)-$(VERSION).tar rm -rf $(PACKAGE)-$(VERSION) buildrpm: rpm -ta $(RPMOPT) $(PACKAGE)-$(VERSION).tar.bz2 # rules to build a distributable rpm rpm: changelog cvstag dist buildrpm dist: cleandist dir export tar export: cvs export -d $(PACKAGE)-$(VERSION) -r $(TAG) $(PACKAGE) cvstag: cvs tag $(CVSTAGOPT) $(TAG) changelog: ../common/username cvs2cl -U ../common/username -I ChangeLog rm -f ChangeLog.bak cvs commit -m "Generated by cvs2cl the `date '+%d_%b'`" ChangeLog