-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (41 loc) · 810 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
48
49
# Makefile
all: prog
prog: ls arch
ls: ls.c
@if [ -d /selinux ];\
then\
echo "cc -o ls ls.c -DSELINUX -lselinux";\
cc -o ls ls.c -DSELINUX -lselinux;\
else\
echo "cc -o ls ls.c";\
cc -o ls ls.c;\
fi
arch: arch.c
cc arch.c -o arch
debug: ls_debug arch_debug
ls_debug: ls.c
@if [ -d /selinux ];\
then\
echo "cc -g -o ls -DLS_DEBUG -DSELINUX ls.c -lselinux";\
cc -g -o ls -DLS_DEBUG -DSELINUX ls.c -lselinux;\
else\
echo "cc -g -o ls -DLS_DEBUG ls.c";\
cc -g -o ls -DLS_DEBUG ls.c;\
fi
arch_debug: arch.c
cc -g arch.c -o arch
.PHONY: test
test:
/bin/bash test.sh
.PHONY: lint
lint:
@type splint > /dev/null 2>&1;\
if [ $? -e 0 ];\
then\
splint ls.c -posix-lib -nullassign | head -n 20;\
else\
echo "no lint program found";\
fi
.PHONY: clean
clean:
rm -f ls arch a.out