-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
65 lines (56 loc) · 1.59 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
#
# pksh - The Packet Shell
#
# R. Carbone (rocco@tecsiel.it)
# 2008-2009, 2022
#
# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
#
# The name of the game
PACKAGE = pksh
# Root installation directory
INSTDIR = /usr/local/${PACKAGE}
# The list of directories where to make something
SUBDIRS += src
SUBDIRS += shell
# The main target is responsible to recursively scan subdirectories and build all the modules
all: ${PACKAGE}/config.status ${SUBDIRS}
@for dir in ${SUBDIRS} ; do \
if [ -d $$dir ] ; then \
if [ -f $$dir/Makefile ] ; then \
echo "Making everything in [$$dir] ..." ; \
make -C $$dir -s --no-print-directory $@ ; \
fi ; \
else \
echo "Warning: missing directory [$$dir]" ; \
fi \
done
${PACKAGE}/config.status:
@./configure
# Cleanup rules
clean:
@rm -f *~
@for dir in ${SUBDIRS} ; do \
if [ -d $$dir ] ; then \
if [ -f $$dir/Makefile ] ; then \
make -C $$dir -s --no-print-directory $@ ; \
fi \
fi \
done
distclean: clean
@rm -rf ${PACKAGE}/
# Targets that are eventually handled by recursive Makefile(s)
%:
@for dir in ${SUBDIRS} ; do \
if [ -d $$dir ] ; then \
echo $$dir; \
if [ -f $$dir/Makefile ] ; then \
make -C $$dir -s --no-print-directory $@ ; \
echo ; \
fi ; \
else \
echo "Warning: missing directory [$$dir]" ; \
fi \
done
# Fake targets
.PHONY: all clean distclean ${SUBDIRS}