star-build

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

scdoc.mk.in (1537B)


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