Skip to content
Snippets Groups Projects
Makefile 1.19 KiB
Newer Older
  • Learn to ignore specific revisions
  • Eric Vidal's avatar
    Eric Vidal committed
    #
    # This Makefile requires GNU make.
    #
    # Do not make changes here.
    # Use the included .mak files.
    #
    
    make_need := 3.81
    ifeq "" "$(strip $(filter $(make_need), $(firstword $(sort $(make_need) $(MAKE_VERSION)))))"
    fail := $(error Your make ($(MAKE_VERSION)) is too old. You need $(make_need) or newer)
    endif
    
    -include config.mak
    include package/targets.mak
    
    INSTALL := ./tools/install.sh
    
    
    Eric Vidal's avatar
    Eric Vidal committed
    install: install-module install-script
    install-module: $(MODULE_TARGET:module/%=$(DESTDIR)$(service_directory)/$(package)/%)
    install-script: $(SCRIPT_TARGET:module/configure/%=$(DESTDIR)$(service_directory)/$(package)/configure/%)
    
    Eric Vidal's avatar
    Eric Vidal committed
    
    
    Eric Vidal's avatar
    Eric Vidal committed
    $(DESTDIR)$(service_directory)/$(package)/%: module/%
    
    Eric Vidal's avatar
    Eric Vidal committed
    	exec $(INSTALL) -D -m 644 $< $@
    
    	sed -i -e 's,%%VERSION%,$(version),' \
    		-e "s,%%LIVEDIR%%,$(livedir)," \
    		-e "s,%%USER_CONF_DIR%%,$(service_userconf)," \
    		-e "s,%%LOGGER%%,$(LOGGER)," \
    		-e "s,%%USE_ENVIRONMENT%%,$(USE_ENVIRONMENT)," \
    		-e "s,%%VERBOSITY_LEVEL%%,$(VERBOSITY_LEVEL)," \
    		-e "s,%%NOTIFY%%,$(NOTIFY)," $@
    
    Eric Vidal's avatar
    Eric Vidal committed
    
    
    Eric Vidal's avatar
    Eric Vidal committed
    $(DESTDIR)$(service_directory)/$(package)/configure/%: module/configure/%
    	exec $(INSTALL) -D -m 755 $< $@
    
    	sed -i -e 's,%%BINDIR%%,$(bindir),' $@
    
    Eric Vidal's avatar
    Eric Vidal committed
    
    
    Eric Vidal's avatar
    Eric Vidal committed
    version:
    	@echo $(version)
    
    .PHONY: install version
    
    .DELETE_ON_ERROR: