#!/usr/bin/make -f #*****************************************************************************# # Include variables and message subsystem # #*****************************************************************************# include Makefile.vars Makefile.msg #*****************************************************************************# # General targets # #*****************************************************************************# # Build everything. all: all-sets # Mostly clean everything. mostlyclean mclean: mostlyclean-sets # Clean everything. fclean clean: clean-sets # Clean to original state. mrproper: clean $(call rmsg,Removing configuration.) $(call qcmd,$(RM) Makefile.cfg) # Remake everything (clean and build). re: clean all # Install everything. install: install-sets # Make a distribution tarball. dist: mrproper $(call bcmd,mkdir,$(NAME)-$(VERSION), $(MD) .dist) $(call bcmd,cp,* $(NAME)-$(VERSION), $(CP) -R * .dist) $(call qcmd,$(MV) .dist $(NAME)-$(VERSION)) $(call bcmd,tarball,$(NAME)-$(VERSION),\ tar czf $(NAME)-$(VERSION).tar.gz --exclude .git $(NAME)-$(VERSION)) $(call qcmd,$(RM) -r $(NAME)-$(VERSION)) .PHONY: all mostlyclean mclean clean fclean mrproper re .PHONY: dist install #*****************************************************************************# # Configuration (version) checking dependencies # #*****************************************************************************# # Define the dependencies. CHECKCFG := $(if $(shell test -f Makefile.cfg || echo y),check-config, \ $(if $(shell [ "$(VERSION)" = "$(CONFIG_VERSION)" ] || echo y), \ check-config-version)) # Define the rules. check-config: @echo -e "\033[1;31mNo configuration file found!" @echo -e "You should configure before re-running this target.\033[0m" @false check-config-version: @echo -e "\033[1;31mConfiguration version is incorrect!" @echo -e "You should re-configure before re-running this target.\033[0m" @false .PHONY: check-config check-config-version #*****************************************************************************# # Information getting from the Makefile variables # #*****************************************************************************# # Get the project name. getname: @echo $(NAME) # Get the project version. getversion: @echo $(VERSION) # Get the maintainer. getmaintainer: @echo "Thomas \"Cakeisalie5\" Touhey " .PHONY: getname getversion getmaintainer #*****************************************************************************# # Sets-related targets # #*****************************************************************************# # Make the sets. all-sets: $(SET_FILES) $(SET_FILES): $(CHECKCFG) $(REF) tools/makebin.py $(call bcmd,makebin,$(SETDIR),\ tools/makebin.py --output $(SETDIR) --refpath $(REFDIR)) # Clean all of the sets clean-sets: $(call rmsg,Cleaning the sets.) $(call qcmd,rm -rf $(SETDIR)) # Install all of the sets. install-sets: all-sets $(call imsg,Installing the sets.) $(call qcmd,$(MD) "$(ISETDIR)") $(call qcmd,$(INSTALL) $(SETS) "$(ISETDIR)") .PHONY: all-sets clean-sets install-sets # End of file.