-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 931 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
36
37
38
39
40
41
42
43
44
45
46
47
SHELL = /bin/sh
COMP = $(component)
BINDIR = bin
LIBDIR = lib
COMPDIR = component
SYSTYPE = `$(SHELL) systype.sh`
DIRS = ./utils
DIRS +=./csf/confparser
#DIRS +=./csf/monitor
DIRS +=./csf
DIRS +=`if [ ! $(COMP) -o $(COMP) = $(COMPDIR) ]; then echo ''; else echo './$(COMPDIR)'; fi;`
.PHONY: default update clean install clean_all checkdir
default: update
update: checkdir
$(MAKE) -f $(SYSTYPE).mk dirs="$(DIRS)" comp="$(COMP)"
clean:
if [ $(COMP) ]; then \
$(MAKE) clean -f $(SYSTYPE).mk dirs="$(DIRS)" comp="$(COMP)"; \
else \
$(MAKE) clean_all; \
$(MAKE) clean -f $(SYSTYPE).mk dirs="$(DIRS)"; \
fi;
install:
$(MAKE) install -f $(SYSTYPE).mk dirs="$(DIRS)" comp="$(COMP)"
clean_all:
rm -f $(LIBDIR)/*
rm -f $(BINDIR)/*
checkdir:
@(echo "[checking necessary directory.]");
if [ ! -d "$(BINDIR)" ]; then \
mkdir -p $(BINDIR); \
fi; \
if [ ! -d "$(LIBDIR)" ]; then \
mkdir -p $(LIBDIR); \
fi;