star-build

Automation tool for project installation
git clone git://git.meso-star.fr/star-build.git
Log | Files | Refs | README | LICENSE

scdoc.mk.in (1506B)


      1 # Copyright (C) 2023-2025 |Méso|Star> (contact@meso-star.com)
      2 #
      3 # This program is free software: you can redistribute it and/or modify
      4 # it under the terms of the GNU General Public License as published by
      5 # the Free Software Foundation, either version 3 of the License, or
      6 # (at your option) any later version.
      7 #
      8 # This program is distributed in the hope that it will be useful,
      9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11 # GNU General Public License for more details.
     12 #
     13 # You should have received a copy of the GNU General Public License
     14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
     15 
     16 # Configuration macros
     17 SCDOC_TAG = @TAG@
     18 SCDOC_URL = https://git.sr.ht/~sircmpwn/scdoc
     19 
     20 # Helper macros
     21 SCDOC_DIR = $(CACHE)/scdoc/$(SCDOC_TAG)
     22 
     23 scdoc: build_scdoc
     24 	@prefix=$$(cat .prefix) && \
     25 	cd -- "$(SCDOC_DIR)" && $(MAKE) PREFIX="$${prefix}" install
     26 
     27 build_scdoc: fetch_scdoc prefix
     28 	@cd -- "$(SCDOC_DIR)" && $(MAKE)
     29 
     30 $(SCDOC_DIR):
     31 	@git clone $(SCDOC_URL) "$@"
     32 
     33 fetch_scdoc: $(SCDOC_DIR)
     34 	@cd -- "$(SCDOC_DIR)" && \
     35 	git fetch origin && \
     36 	git checkout -B star-build && \
     37 	git reset --hard $(SCDOC_TAG)
     38 
     39 clean_scdoc:
     40 	if [ -d "$(SCDOC_DIR)" ]; then \
     41 		cd -- "$(SCDOC_DIR)" && $(MAKE) clean; \
     42 	fi
     43 
     44 uninstall_scdoc: fetch_scdoc prefix
     45 	@prefix=$$(cat .prefix) && \
     46 	cd -- "$(SCDOC_DIR)" && $(MAKE) PREFIX="$${prefix}" uninstall
     47 
     48 clean_all: clean_scdoc
     49 install_all: scdoc
     50 uninstall_all: uninstall_scdoc