Skip to content

Commit fad0f1e

Browse files
authored
Merge pull request #29 from strangepete/jpm-defs
Additional jpm defs
2 parents 204e22c + 92fe32d commit fad0f1e

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

libs/jpm-defs.janet

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,61 @@
7474
"Define your project metadata. This should
7575
be the first declaration in a project.janet file.
7676
Also sets up basic task targets like clean, build, test, etc."
77-
[&keys meta])
77+
[&keys meta])
78+
79+
(defn add-input
80+
"Add a dependency to an existing rule. Useful for extending phony
81+
rules or extending the dependency graph of existing rules."
82+
[target input])
83+
84+
(defn add-dep
85+
"Alias for `add-input`"
86+
[target dep])
87+
88+
(defn add-output
89+
"Add an output file to an existing rule. Rules can contain multiple
90+
outputs, but are still referred to by a main target name."
91+
[target output])
92+
93+
(defn add-thunk
94+
"Append a thunk to a target's recipe."
95+
[target thunk])
96+
97+
(defmacro rule
98+
"Add a rule to the rule graph."
99+
[target deps & body])
100+
101+
(defmacro task
102+
"Add a task rule to the rule graph. A task rule will always run if invoked
103+
(it is always considered out of date)."
104+
[target deps & body])
105+
106+
(defmacro phony
107+
"Alias for `task`."
108+
[target deps & body])
109+
110+
(defmacro sh-rule
111+
"Add a rule that invokes a shell command, and fails if the command returns non-zero."
112+
[target deps & body])
113+
114+
(defmacro sh-task
115+
"Add a task that invokes a shell command, and fails if the command returns non-zero."
116+
[target deps & body])
117+
118+
(defmacro sh-phony
119+
"Alias for `sh-task`"
120+
[target deps & body])
121+
122+
(defmacro phony
123+
"Alias for `task`"
124+
[target deps & body])
125+
126+
(defmacro add-body
127+
"Add recipe code to an existing rule. This makes existing rules do more but
128+
does not modify the dependency graph."
129+
[target & body])
130+
131+
(def default-cflags [])
132+
(def default-lflags [])
133+
(def default-ldflags [])
134+
(def default-cppflags [])

0 commit comments

Comments
 (0)