-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mkdoc-minimal.mk
100 lines (64 loc) · 2.41 KB
/
Mkdoc-minimal.mk
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Non-recursive makefile
# Id: mkdoc/0.0.2-test+20150804-0404 Mkdoc-minimal.mk
# CURDIR and MAKEFILE_LIST are GNU Make internals
location = $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
# Global list of all makefiles
MK := $(location)
#MK += $(DIR)/Makefile
# Set level to warning and above
VERBOSE ?= 4
ifneq ($(V), )
VERBOSE := $(V)
endif
PREFIX ?= ./usr
MK_SHARE ?= $(PREFIX)/share/mkdoc/
#MK_CONF := /etc/mkdoc/ $(HOME)/.mkdoc/
MK_BUILD ?= /var/mkdoc/
PROJECT := mkdoc
VERSION := 0.0.2-test+20150804-0404# mkdoc
MKDOC_VERSION := 0.0.2-test+20150804-0404# mkdoc
# FIXME: rewrite to MK_BUILD
BUILD ?= .build/
# Start keeping present directory
DIR := .
# ------------ --
d := $(DIR)
MK_$d := Mkdoc-minimal
# ------------ --
ifeq ($(MAKECMDGOALS),info)
$(info Heads up, running 'make info V=$(VERBOSE)', use lower values for less info. )
endif
include $(MK_SHARE)Core/Main.mk
ifeq ($(MAKECMDGOALS),info)
$(info $(shell $(ll) info info "OK loaded $(MK_SHARE)Core/Main.mk"))
endif
$(call chat,header,mkdoc,Core script loaded)
# Check wether this filename (target of the Makefile symlink) corresponds to MK_$d
ifneq ($(shell [ -L "$(MK)" ] && basename $$(readlink $(MK)) .mk),$(MK_$d))
$(call chat,warn,mkdoc,Do not link Makefile but rather $(MK_$d))
endif
# ------------ --
$(call chat,debug,mkdoc,Reading package main include files)
#include \
$(MK_SHARE)<package_name>/Main.mk \
# ------------ --
$(call chat,header,mkdoc,Reading default rules from packages)
#include \
$(MK_SHARE)<package_name>/Rules.default.mk \
$(call chat,debug,mkdoc,Done loading packages rules files)
$(call chat,debug,mkdoc)
# ------------ --
$(call chat,header,mkdoc,Reading local rules)
# Include specific rules and set SRC, DEP, TRGT and CLN variables.
#
include $(call rules,$(DIR)/)
# ------------ --
$(call chat,header,mkdoc,Reading standard rules)
# Now set some standard targets
#
include $(MK_SHARE)Core/Rules.default.mk
# ------------ --
$(call chat,debug,mkdoc)
$(call chat,OK,mkdoc,starting 'make $(MAKECMDGOALS)')
$(call chat,debug,mkdoc)
# vim:ft=make: