view emacs/Makefile @ 648:898e6d98f933

Translated comments into English.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 19 Dec 2018 01:06:46 +0200
parents 44b6346fd952
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

################################################################
# Arch definitions.

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

build_os = unix
ifneq '' '$(filter MINGW%,$(uname-s))'
  build_os = mingw
endif
ifneq '' '$(filter CYGWIN%,$(uname-s))'
  build_os = cygwin
endif
ifeq 'SunOS' '$(uname-s)'
  build_os = solaris
endif

install-win :=
ifneq '' '$(filter $(build_os),mingw cygwin)'
  install-win := install-win
endif

################################################################
# Build toolchain definition.

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

################################################################
# Path/file definitions.

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

bindir = $(prefix)/bin
mandir = $(prefix)/share/man
man1dir = $(mandir)/man1

MAN1_FILES := $(wildcard e*.1)
BIN_FILES := e ew ec et

################################################################
# Build definitions.

.PHONY: all
all: help

.PHONY: check
check:

.PHONY: install
install: install-unix $(install-win)

.PHONY: install-unix
install-unix: install-init
	$(INSTALL_PROGRAM) e $(bindir)
	ln -s -f $(bindir)/e $(bindir)/ew
	ln -s -f $(bindir)/e $(bindir)/ec
	ln -s -f $(bindir)/e $(bindir)/et
	for file in $(MAN1_FILES); do \
		$(INSTALL_DATA) $$file $(man1dir); \
	done

.PHONY: install-win
install-win: install-init
	\
$(INSTALL_PROGRAM) re.bat $(bindir)/re.bat; \
for f in $(BIN_FILES); do \
  $(INSTALL_PROGRAM) e.bat $(bindir)/$$f.bat; \
done

.PHONY: install-init
install-init:
	[ -d $(bindir) ] || mkdir -p $(bindir)
	[ -d $(man1dir) ] || mkdir -p $(man1dir)

.PHONY: uninstall
uninstall:
	rm -f $(patsubst %,$(bindir)/%,$(BIN_FILES)) $(patsubst %,$(bindir)/%.bat,$(BIN_FILES))
	for f in $(MAN1_FILES); do \
		rm -f $(man1dir)/$$f; \
	done

.PHONY: distclean
distclean: clean

.PHONY: clean
clean: