-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 790 Bytes
/
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
all:
@if [ -e src/Makefile ]; then \
$(MAKE) -C src $(MAKEFLAGS); \
else \
if [ -e mf/Makefile.$$(uname) ]; then \
ln -s ../mf/Makefile.$$(uname) src/Makefile && \
$(MAKE) -C src $(MAKEFLAGS); \
else \
echo "Run: make <target>" && \
echo "Available targets are:" && \
ls mf/ | sed 's/Makefile\.//g'; \
fi \
fi
.PHONY: clean install distclean
install:
$(MAKE) -C src $(MAKEFLAGS) install
uninstall:
$(MAKE) -C src $(MAKEFLAGS) uninstall
clean:
$(MAKE) -C src $(MAKEFLAGS) clean
distclean:
-$(MAKE) -C src $(MAKEFLAGS) clean
-rm src/Makefile
.DEFAULT:
@if [ -e src/Makefile ]; then rm src/Makefile; fi
@if ! [ -f mf/Makefile.$@ ]; then \
echo "Invalid target name: $@" && exit 1; fi
ln -s ../mf/Makefile.$@ src/Makefile
$(MAKE) -C src $(MAKEFLAGS)