view dvcs/Makefile @ 663:136298c89fdd default tip

Enabling of "Developer mode" to allow symlinks without elevation.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Sun, 15 Nov 2020 15:24:16 +0200
parents 06d957e2cdce
children
line wrap: on
line source

SHELL = /bin/sh

# Disable built in pattern rules.
MAKEFLAGS += -r
# Disable built in variables.
MAKEFLAGS += -R
# Disable built in suffix rules.
.SUFFIXES:
# Delete target file if command fails.
.DELETE_ON_ERROR:
# Default target.
.DEFAULT_GOAL = all

ifeq '' '$(prefix)'
  ifneq '' '$(HOME)'
    prefix = $(HOME)/usr
  else
    $(error HOME env var and prefix var are not set!)
  endif
endif

################################################################
# Platform definition.

uname-s := $(shell uname -s)

build_os = unix
ifeq 'SunOS' '$(uname-s)'
  build_os = solaris
endif

################################################################
# Build tools definition.

INSTALL_PROGRAM := install -m 755
ifeq 'solaris' '$(build_os)'
  INSTALL_PROGRAM := ginstall -m 755
endif

################################################################
# Installation directories.

bindir = $(prefix)/bin

################################################################
# Build targets.

.PHONY: all
all:

.PHONY: check
check:

HG_BIN_FILES := myhg-nearest-tag myhg-tags
GIT_BIN_FILES := mygit-nearest-tag mygit-glog mygit-tags
BIN_FILES := $(HG_BIN_FILES) $(GIT_BIN_FILES)

.PHONY: install
install:
	[ -d $(bindir) ] || mkdir -p $(bindir)
	\
for f in $(BIN_FILES); do \
  $(INSTALL_PROGRAM) $$f $(bindir); \
done

INSTALLED_FILES := $(patsubst %,$(bindir)/%,$(BIN_FILES))

.PHONY: uninstall
uninstall:
	for file in $(INSTALLED_FILES); do \
		[ -e $$file ] && if rm $$file; then :; else echo Unable to delete $$file; exit 1; fi || :; \
	done

.PHONY: distclean
distclean: clean

.PHONY: clean
clean: