-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (26 loc) · 1.02 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
SHELL=/bin/sh
DIRS=lib include ups src
#
# PREFIX is used solely for the install target, right?
#
# Set PREFIX to "." in undefined -- FM
ifndef PREFIX
export PREFIX=.
endif
#
# The pattern of this makefile is to call a subordinate makefile for each of the tasks, if a Makefile is
# is present in the subordinate directory, else to to the task. Install is an exception.
#
all:
for d in $(DIRS) ; do if [ -e $$d/Makefile ] ; then (cd $$d;$(MAKE) $(MAKEFLAGS) all ) fi ; done
clean: tidy
for d in $(DIRS) ; do if [ -e $$d/Makefile ] ; then (cd $$d;$(MAKE) $(MAKEFLAGS) clean ) fi ; done
tidy:
for d in $(DIRS) ; do if [ -e $$d/Makefile ] ; then (cd $$d;$(MAKE) $(MAKEFLAGS) tidy ) fi ; done
for d in $(DIRS) ; do if [ ! -e $$d/Makefile ] ; then (cd $$d ; rm -f \#*\# *~ ) fi ; done
rm -rf \#*\# *~
install: tidy
if [ -z "$(PREFIX)" ] ; then echo install area not defined; exit 1 ; fi
echo about to install under $(PREFIX)
sleep 5
for d in $(DIRS) ; do mkdir -p $(PREFIX)/$$d ; cp $$d/* $(PREFIX)/$$d ; done