-
Notifications
You must be signed in to change notification settings - Fork 0
/
gmil
44 lines (29 loc) · 1.13 KB
/
gmil
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
# Determine if the library has already been included and if so don't
# bother including it again
ifndef __gmil_included
# Standard definitions for true and false. true is any non-empty
# string, false is an empty string. These are intended for use with
# $(if).
true := T
false :=
# ----------------------------------------------------------------------------
# Function: not
# Arguments: 1: A boolean value
# Returns: Returns the opposite of the arg. (true -> false, false -> true)
# ----------------------------------------------------------------------------
not = $(if $1,$(false),$(true))
# Prevent reinclusion of the library
__gmil_included := $(true)
# Try to determine where this file is located. If the caller did
# include /foo/gmil then extract the /foo/ so that __gmil gets
# included transparently
__gmil_root :=
ifneq ($(MAKEFILE_LIST),)
__gmil_root := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
# If there are any spaces in the path in __gmil_root then give up
ifeq (1,$(words $(__gmil_root)))
__gmil_root := $(patsubst %gmil,%,$(__gmil_root))
endif
endif
include $(__gmil_root)__gmil.mk
endif # __gmil_included