This repository was archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.inc
More file actions
77 lines (60 loc) · 1.26 KB
/
Makefile.inc
File metadata and controls
77 lines (60 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# These are lazy variables, and will be expanded
# when needed.
##
#
# RedHat
#
YUM = $(notdir $(shell which yum))
#
# OSX
#
BREW = $(notdir $(shell which brew))
#
# UBUNTU
#
APT = $(notdir $(shell which apt-get))
#
# ENVIRONMENT
#
IS_BASH_PRESENT := $(notdir $(shell which bash))
IS_ZSH_PRESENT := $(notdir $(shell which zsh))
OPERATIVE_SYSTEM := unsupported
PACKAGE_INSTALL :=
#
# PACKAGES
#
AG_PACKAGE =
GIT_PACKAGE = git
VIM_PACKAGE = vim
CURL_PACKAGE = curl
TREE_PACKAGE = tree
#
# Detect operative system and package manager
#
ifeq ($(IS_BASH_PRESENT),bash)
SHELL := /bin/bash
else ifeq ($(IS_ZSH_PRESENT),zsh)
SHELL := /bin/bash
else
# NOT SUPPORTED for other shells
SHELL := $(wich nologin)
endif
ifeq ($(shell uname -s),Linux)
OPERATIVE_SYSTEM = unsupported_linux
ifeq ($(YUM),yum)
OPERATIVE_SYSTEM = redhat
PACKAGE_INSTALL = sudo yum install --quiet -y
AG_PACKAGE = the_silver_searcher
endif
ifeq ($(APT),apt-get)
OPERATIVE_SYSTEM = ubuntu
PACKAGE_INSTALL = sudo apt-get install -q=2 -y
AG_PACKAGE = silversearcher-ag
GIT_PACKAGE = git-core
endif
endif
ifeq ($(shell uname -s),Darwin)
OPERATIVE_SYSTEM = darwin
PACKAGE_INSTALL = brew install
AG_PACKAGE = the_silver_searcher
endif