-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (34 loc) · 1.13 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
DIRS = bin lib
#-------------------------------------------------------------------------------
# target all:
all: dirs bin lib
help:
@echo "all: create ($(DIRS)) subdirectory and make lib and bin"
@echo "dirs: create ($(DIRS)) subdirectory"
@echo "lib: compile the code and create dynamic library file in lib"
@echo "bin: compile the code and create test c program file in bin"
@echo "clean: clean /src subdirectory"
.PHONY: depend clean bin lib
#-------------------------------------------------------------------------------
# target dirs:
dirs:
-@for i in $(DIRS) ; do \
(if [ -d $$i ]; \
then \
echo DIR $$i exists; \
else \
echo DIR $$i created; \
mkdir $$i; \
fi); done
#-------------------------------------------------------------------------------
# target bin: runs make bin in /src
bin:
(cd src; $(MAKE) bin)
#-------------------------------------------------------------------------------
# target lib: runs make lib in /src
lib:
(cd src; $(MAKE) lib)
#-------------------------------------------------------------------------------
# target clean:
clean:
(cd src; $(MAKE) clean)