-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
603 lines (577 loc) · 16.1 KB
/
Makefile
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# Copyright 2018 Azure Zanculmarktum <[email protected]>
# $(cwd) = ../.. means this script is inside slackbuilds/category/package/
# $(cwd) = .. means this script is inside slackbuilds/category/
# $(cwd) = . means this script is inside slackbuilds/
cwd = $(subst /Makefile,,$(shell readlink Makefile))
ifeq ($(cwd), )
cwd = .
endif
ifeq ($(cwd), .)
path =
else
path = $(cwd)/
endif
cmds = search isearch esearch unpack dist-clean-all
ifeq ($(cwd), .)
cmds += link delink
endif
ifeq ($(cwd), ../..)
cmds += fetch md5 dist-clean install deinstall clean list-depends list-depends-reverse template
endif
ifeq ($(cwd), ../..)
package = $(notdir $(CURDIR))
category = $(notdir $(subst /$(package),,$(CURDIR)))
DISTDIR = $(cwd)/distfiles/$(package)
WORKDIR = work
PKGSDIR = $(cwd)/packages
endif
ifneq ($(cwd), ../..)
all:
@echo "Usage: $(MAKE) command [command ...]" >&2; \
echo " $(MAKE) help" >&2
else
all:
@[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
[ -f "$(package).SlackBuild" ] || git checkout $(package).SlackBuild; \
eval $$(grep '^\(BUILD\|TAG\)=' $(package).SlackBuild); \
case "$$( uname -m )" in \
i?86) ARCH="i?86" ;; \
arm*) ARCH="arm*" ;; \
*) ARCH=$$( uname -m ) ;; \
esac; \
\
found=false; \
for i in \
$(PKGSDIR)/$$PRGNAM-$$VERSION-$$ARCH-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-fw-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-noarch-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-x86-$$BUILD$$TAG.txz; \
do \
[ -f "$$i" ] || continue; \
found=true; \
break; \
done; \
if ! $$found || [ "$(force)" = "true" ]; then \
DELETED=$$(git diff-files --name-only --diff-filter=D --relative); \
if [ -n "$$DELETED" ]; then \
echo "==> Restoring upstream files..."; \
for i in $$DELETED; do \
echo " => $$i"; \
done; \
git checkout $$DELETED; \
fi; \
\
if [ ! -d "$(DISTDIR)" ]; then \
if [ -t 1 ]; then \
echo -e "\e[0;31m--> No sources were found in $(DISTDIR)\e[0m" >&2; \
else \
echo "--> No sources were found in $(DISTDIR)" >&2; \
fi; \
exit 1; \
fi; \
if rmdir $(DISTDIR)/ >/dev/null 2>&1; then \
if [ -t 1 ]; then \
echo -e "\e[0;31m--> No sources were found in $(DISTDIR)\e[0m" >&2; \
else \
echo "--> No sources were found in $(DISTDIR)" >&2; \
fi; \
exit 1; \
fi; \
\
echo "==> Preparing..."; \
for i in $(WORKDIR) $(PKGSDIR); do \
if [ ! -d "$$i" ]; then \
mkdir -p $$i; \
if [ "$$?" = "0" ]; then \
echo " => $$i/ created"; \
else \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $$i/ can't be created\e[0m" >&2; \
else \
echo " -> $$i/ can't be created" >&2; \
fi; \
fi; \
fi; \
done; \
for i in $(DISTDIR)/* $(DISTDIR)/.*; do \
if [ "$${i##*/}" = "." -o "$${i##*/}" = ".." ]; then \
continue; \
fi; \
if [ ! -L "$${i##*/}" ]; then \
ln -sf "$$i" "$${i##*/}"; \
if [ "$$?" = "0" ]; then \
echo " => $${i##*/}@ linked"; \
else \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $${i##*/}@ can't be linked\e[0m" >&2; \
else \
echo " -> $${i##*/}@ can't be linked" >&2; \
fi; \
fi; \
fi; \
done; \
\
echo "==> Building..."; \
FAKEROOT=""; \
if [ "$$(id -u)" != "0" ]; then \
which fakeroot >/dev/null 2>&1 && FAKEROOT=fakeroot; \
fi; \
[ -x "$(package).SlackBuild" ] || chmod +x $(package).SlackBuild; \
PATH=/usr/local/sbin:/usr/sbin:/sbin:$$PATH \
TMP="$(abspath $(WORKDIR))" \
OUTPUT="$(abspath $(PKGSDIR))" \
PKGTYPE="txz" \
$$FAKEROOT ./$(package).SlackBuild; \
fi
install: all
@[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
[ -f "$(package).SlackBuild" ] || git checkout $(package).SlackBuild; \
eval $$(grep '^\(BUILD\|TAG\)=' $(package).SlackBuild); \
case "$$( uname -m )" in \
i?86) ARCH="i?86" ;; \
arm*) ARCH="arm*" ;; \
*) ARCH=$$( uname -m ) ;; \
esac; \
\
found=false; \
for i in /var/log/packages/$$PRGNAM-$$VERSION-*; do \
[ -f "$$i" ] || continue; \
found=true; \
break; \
done; \
if ! $$found; then \
pkgs=""; \
i=1; \
for j in \
$(PKGSDIR)/$$PRGNAM-$$VERSION-$$ARCH-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-fw-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-noarch-$$BUILD$$TAG.txz \
$(PKGSDIR)/$$PRGNAM-$$VERSION-x86-$$BUILD$$TAG.txz; \
do \
[ -f "$$j" ] || continue; \
pkgs="$$pkgs $$i|$${j##*/}"; \
i=$$(($$i+1)); \
done; \
\
npkg=$$(echo $$pkgs | awk '{ print NF }'); \
if [ "$$npkg" -eq 0 ]; then \
echo -e "\e[0;31m--> No $(package) package was found in $(PKGSDIR)\e[0m" >&2; \
elif [ "$$npkg" -eq 1 ]; then \
/sbin/upgradepkg --install-new "$(abspath $(PKGSDIR))/$${pkgs#*|}"; \
else \
echo "==> More than one $(package) package were found in $(PKGSDIR):"; \
for i in $$pkgs; do \
echo " => [$${i%|*}] $${i#*|}"; \
done; \
echo ""; \
while :; do \
echo -n "==> Select which one to $@: "; \
read n; \
j=""; \
for i in $$pkgs; do \
if [ "$${i%|*}" = "$$n" ]; then \
j="$${i#*|}"; \
break; \
fi; \
done; \
if [ -n "$$j" ]; then \
/sbin/upgradepkg --install-new "$(abspath $(PKGSDIR))/$$j"; \
break; \
fi; \
echo -e "\e[0;31m -> incorrect input\e[0m" >&2; \
done; \
fi; \
fi
deinstall:
@[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
[ -f "$(package).SlackBuild" ] || git checkout $(package).SlackBuild; \
eval $$(grep '^\(BUILD\|TAG\)=' $(package).SlackBuild); \
case "$$( uname -m )" in \
i?86) ARCH="i?86" ;; \
arm*) ARCH="arm*" ;; \
*) ARCH=$$( uname -m ) ;; \
esac; \
\
found=false; \
for i in /var/log/packages/$$PRGNAM-*; do \
[ -f "$$i" ] || continue; \
j="$${i##*/}"; \
j="$${j%-*}"; \
j="$${j%-*}"; \
j="$${j%-*}"; \
if [ "$$j" = "$$PRGNAM" ]; then \
found=true; \
break; \
fi; \
done; \
if $$found; then \
/sbin/removepkg "$$i"; \
fi
clean:
@echo "==> Cleaning up..."; \
if [ -d "$(WORKDIR)" ]; then \
rm -Rf $(WORKDIR); \
if [ "$$?" = "0" ]; then \
echo " => $(WORKDIR)/ deleted"; \
else \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $(WORKDIR)/ can't be deleted\e[0m" >&2; \
else \
echo " -> $(WORKDIR)/ can't be deleted" >&2; \
fi; \
fi; \
fi; \
\
for i in * .*; do \
if [ "$$i" = "." -o "$$i" = ".." ]; then \
continue; \
fi; \
refer="$$(readlink $$i)"; \
if [ "$${refer#$(DISTDIR)}" != "$$refer" ]; then \
rm -Rf "$$i"; \
if [ "$$?" = "0" ]; then \
echo " => $$i@ unlinked"; \
else \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $$i@ can't be unlinked\e[0m" >&2; \
else \
echo " -> $$i@ can't be unlinked" >&2; \
fi; \
fi; \
fi; \
done
_depends:
@[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
for i in $$REQUIRES; do \
[ "$$i" = "%README%" ] && continue; \
if [ -d "$(path)local/$$i" ]; then \
path="$(path)local/$$i"; \
else \
path=$$($(MAKE) -s esearch name=$$i); \
fi; \
( cd $$path && $(MAKE) -s $@ ); \
echo $$path; \
done | awk '{ if (!dups[$$0]++) print }'
list-depends: _depends
@echo $(cwd)/$(category)/$(package)
list-depends-reverse:
@for i in /var/log/packages/*_SBo; do \
[ -f "$$i" ] || continue; \
j="$${i##*/}"; \
j="$${j%-*}"; \
j="$${j%-*}"; \
j="$${j%-*}"; \
echo $$j; \
done
fetch:
@[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
url="$$DOWNLOAD"; \
if [ "$$(uname -m)" = "x86_64" -a -n "$$DOWNLOAD_x86_64" ]; then \
url="$$DOWNLOAD_x86_64"; \
fi; \
if [ "$$url" = "UNSUPPORTED" ]; then \
echo -e "\e[0;31m--> Your architecture ($$(uname -m)) is not supported\e[0m" >&2; \
exit 1; \
fi; \
mkdir -p $(DISTDIR); \
cd $(DISTDIR); \
for i in $$url; do \
[ -f "$${i##*/}" ] && continue; \
echo "==> Fetching $${i##*/}..."; \
while :; do \
curl -L -R -C - -Y 1 -y 10 -k -g -o "$${i##*/}".part "$$i"; \
exitcode="$$?"; \
if [ "$$exitcode" = "0" ]; then \
mv "$${i##*/}".part "$${i##*/}"; \
elif [ "$$exitcode" = "33" ]; then \
rm -f "$${i##*/}".part; \
continue; \
elif [ "$$exitcode" = "18" -o "$$exitcode" = "28" -o "$$exitcode" = "56" ]; then \
continue; \
else \
exit $$exitcode; \
fi; \
break; \
done; \
done
md5:
@if [ ! -d "$(DISTDIR)" ]; then \
if [ -t 1 ]; then \
echo -e "\e[0;31m--> No sources were found in $(DISTDIR)\e[0m" >&2; \
else \
echo "--> No sources were found in $(DISTDIR)" >&2; \
fi; \
exit 1; \
fi; \
if rmdir $(DISTDIR)/ >/dev/null 2>&1; then \
if [ -t 1 ]; then \
echo -e "\e[0;31m--> No sources were found in $(DISTDIR)\e[0m" >&2; \
else \
echo "--> No sources were found in $(DISTDIR)" >&2; \
fi; \
exit 1; \
fi; \
\
[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
\
url="$$DOWNLOAD"; \
if [ "$$(uname -m)" = "x86_64" -a -n "$$DOWNLOAD_x86_64" ]; then \
url="$$DOWNLOAD_x86_64"; \
fi; \
if [ "$$url" = "UNSUPPORTED" ]; then \
echo -e "\e[0;31m--> Your architecture ($$(uname -m)) is not supported\e[0m" >&2; \
exit 1; \
fi; \
\
hash="$$MD5SUM"; \
if [ "$$(uname -m)" = "x86_64" -a -n "$$MD5SUM_x86_64" ]; then \
hash="$$MD5SUM_x86_64"; \
fi; \
\
i=0; \
for a in $$url; do \
j=0; \
for b in $$hash; do \
[ "$$i" -eq "$$j" ] && break; \
j=$$(($$j+1)); \
done; \
echo "$$b $(DISTDIR)/$${a##*/}" | md5sum -c; \
i=$$(($$i+1)); \
done
dist-clean:
@if [ ! -d "$(DISTDIR)" ]; then \
exit 0; \
fi; \
if rmdir $(DISTDIR)/ >/dev/null 2>&1; then \
exit 0; \
fi; \
[ -f "$(package).info" ] || git checkout $(package).info; \
. ./$(package).info; \
url="$$DOWNLOAD"; \
if [ "$$(uname -m)" = "x86_64" -a -n "$$DOWNLOAD_x86_64" ]; then \
url="$$DOWNLOAD_x86_64"; \
fi; \
if [ "$$url" = "UNSUPPORTED" ]; then \
echo -e "\e[0;31m--> Your architecture ($$(uname -m)) is not supported\e[0m" >&2; \
exit 1; \
fi; \
\
echo "==> Cleaning $(DISTDIR)..."; \
cd $(DISTDIR); \
for i in .* *; do \
[ "$$i" = "." -o "$$i" = ".." ] && continue; \
found=false; \
for j in $$url; do \
if [ "$$i" = "$${j##*/}" -o "$$i" = "$${j##*/}".part ]; then \
found=true; \
break; \
fi; \
done; \
if ! $$found; then \
k=""; \
if [ -d "$$i" ]; then \
k="/"; \
fi; \
rm -Rf $$i; \
if [ "$$?" = "0" ]; then \
echo " => $$i$$k deleted"; \
else \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $$i$$k can't be deleted\e[0m"; \
else \
echo " -> $$i$$k can't be deleted"; \
fi; \
fi; \
fi; \
done
template:
ifneq ($(and $(type), $(version), $(homepage), $(description), $(maintainer), $(email)),)
@echo "==> Creating SlackBuild script..."; \
if [ ! -f "$(package).SlackBuild" ]; then \
cp -p $(cwd)/templates/$(type)-template.SlackBuild $(package).SlackBuild; echo " => $(package).SlackBuild created"; \
x=$$(sed -ne '/^# |-----------------------------------------------------------------|/=' $(package).SlackBuild); \
a=$$(echo "$$x" | head -1); \
b=$$(echo "$$x" | tail -1); \
b=$$(($$b+1)); \
sed -i \
-e '/^# Slackware build script for /s/<appname>/$(package)/' \
-e "/^# Copyright/s/<year>/$$(date +%Y)/" \
-e '/^# Copyright/s/<you>/$(maintainer)/' \
-e '/^# Copyright/s/<where you live>/$(email)/' \
-e '/^PRGNAM=/s/=.*/=$(package)/' \
-e '/^VERSION=/s/\(VERSION:-\).*/\1$(version)}/' \
-e '/^TAG=/s/}.*/}/' \
-e '/# Automatically determine the architecture/d' \
-e '/# Unless $$ARCH is already set/d' \
-e '/^TMP=/s/}.*/}/' \
-e '/^OUTPUT=/s/}.*/}/' \
-e '/ # Exit on most errors/s/ #.*//' \
-e '/^\s*\\( -perm 777/s/^\s*/ /' \
-e '/^\s*-o -perm 511/s/^\s*/ /' \
-e '/^\s*\\( -perm 666/s/^\s*/ /' \
-e '/^\s*-o -perm 440/s/^\s*/ /' \
-e "$${a},$${b}d" \
$(package).SlackBuild; \
a=$$(sed -ne '/^# If you prefer/=' $(package).SlackBuild); \
b=$$(sed -ne '/^# then that/=' $(package).SlackBuild); \
if [ -n "$$a" -a -n "$$b" ]; then \
sed -i -e "$${a},$${b}d" $(package).SlackBuild; \
fi; \
fi; \
if [ ! -f "$(package).info" ]; then \
cp -p $(cwd)/templates/template.info $(package).info; echo " => $(package).info created"; \
sed -i \
-e '/^PRGNAM=/s/".*/"$(package)"/' \
-e '/^VERSION=/s/".*/"$(version)"/' \
-e '/^DOWNLOAD=/s/".*/""/' \
-e '/^MD5SUM=/s/".*/""/' \
-e '/^DOWNLOAD_x86_64=/s/".*/""/' \
-e '/^MD5SUM_x86_64=/s/".*/""/' \
-e '/^MAINTAINER=/s/".*/"$(maintainer)"/' \
-e '/^EMAIL=/s/".*/"$(email)"/' \
$(package).info; \
rm -f $(package).info.$$$$; \
while read line; do \
if [ "$${line#HOMEPAGE=}" != "$$line" ]; then \
echo 'HOMEPAGE="$(homepage)"' >> $(package).info.$$$$; \
else \
echo "$$line" >> $(package).info.$$$$; \
fi; \
done < $(package).info; \
mv -f $(package).info.$$$$ $(package).info; \
fi; \
[ -f "README" ] || { cp -p $(cwd)/templates/README .; echo " => README created"; }; \
[ -f "doinst.sh" ] || { cp -p $(cwd)/templates/doinst.sh .; echo " => doinst.sh created"; }; \
if [ ! -f "slack-desc" ]; then \
cp -p $(cwd)/templates/slack-desc . ; echo " => slack-desc created"; \
len=$$(printf "$(package):" | wc -c); \
s=""; \
i=1; \
while [ $$i -lt $$len ]; do \
s="$$s "; \
i=$$(($$i+1)); \
done; \
sed -i \
-e '/^appname:/s/appname (.*/$(package) ($(description))/' \
-e '/^appname:/s/^appname:/$(package):/' \
-e "/^\s*|-----handy-ruler/s/^\s*/$$s/" \
slack-desc; \
fi
else
@echo "Usage: $(MAKE) $@ type=autotools|cmake|haskell|perl|python|rubygem version=1.2.3 homepage=example.com description=short-desc maintainer=your-name email=your-email"
endif
endif # ifneq ($(cwd), ../..)
dist-clean-all:
@for i in $(cwd)/distfiles/*; do \
if [ ! -e "$$i" ]; then \
if [ -t 1 ]; then \
echo -e "\e[0;31m--> No sources were found in $(path)distfiles\e[0m" >&2; \
else \
echo "--> No sources were found in $(path)distfiles" >&2; \
fi; \
exit 1; \
fi; \
(cd $$($(MAKE) -s esearch name="$${i##*/}") && make -s dist-clean); \
done
usage-msg:
ifneq ($(cwd), ../..)
@echo "Usage: $(MAKE) command [command ...]"
else
@echo "Usage: $(MAKE) [command ...]"
endif
help: usage-msg
@echo "Commands:"; \
for i in $(cmds); do \
echo " $$i"; \
done | sort
unpack:
@echo "==> Unpacking..."; \
cd $(cwd); \
git checkout -f master
ifeq ($(cwd), .)
link:
@echo "==> Linking */Makefile and */*/Makefile to Makefile..."; \
cd $(cwd); \
for i in $$(git ls-tree -d --name-only HEAD); do \
if [ ! -L "$$i/Makefile" ]; then \
ln -sr Makefile $$i 2>/dev/null; \
echo " => $(path)$$i/Makefile@ linked"; \
fi; \
\
found=false; \
error=false; \
for j in $$i/*; do \
[ -d "$$j" ] || continue; \
if [ ! -L "$$j/Makefile" ]; then \
found=true; \
ln -sr Makefile $$j 2>/dev/null; \
fi; \
if [ "$$?" != "0" ]; then \
error=true; \
if [ -t 1 ]; then \
echo -e "\e[0;31m -> $$j/Makefile already exists\e[0m" >&2; \
else \
echo " -> $$j/Makefile already exists" >&2; \
fi; \
fi; \
done; \
if $$found && ! $$error; then \
echo " => $(path)$$i/*/Makefile@ linked"; \
fi; \
done
delink:
@echo "==> Unlinking */Makefile and */*/Makefile..."; \
cd $(cwd); \
for i in $$(git ls-tree -d --name-only HEAD); do \
MAKEFILES="$$i/Makefile $$(for j in $$i/*; do \
if [ -L "$$j/Makefile" ]; then \
echo $$j/Makefile; \
fi; \
done)"; \
if [ -n "$$MAKEFILES" ]; then \
rm -Rf $$MAKEFILES; \
if [ "$$?" = "0" ]; then \
echo " => $(path)$$i/Makefile@ unlinked"; \
echo " => $(path)$$i/*/Makefile@ unlinked"; \
fi; \
fi; \
done
endif
search:
ifdef name
@cd $(cwd); \
for i in $$(git ls-tree -d --name-only HEAD); do \
for j in $$i/*; do \
echo "$${j#*/}"; \
done | awk '{ if (index($$0, "$(name)")) print "$(path)'$$i'/" $$0 }'; \
done || true
else
@echo "Usage: $(MAKE) $@ name=package" >&2
endif
isearch:
ifdef name
@cd $(cwd); \
for i in $$(git ls-tree -d --name-only HEAD); do \
for j in $$i/*; do \
echo "$${j#*/}"; \
done | awk '{ if (index(tolower($$0), tolower("$(name)"))) print "$(path)'$$i'/" $$0 }'; \
done || true
else
@echo "Usage: $(MAKE) $@ name=package" >&2
endif
esearch:
ifdef name
@cd $(cwd); \
for i in $$(git ls-tree -d --name-only HEAD); do \
[ -d "$$i/$(name)" ] && echo $(path)$$i/$(name); \
done || true
else
@echo "Usage: $(MAKE) $@ name=package" >&2
endif
.PHONY: all usage-msg _depends $(cmds)