-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (30 loc) · 894 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
BUILD_SUBDIRS = threads userprog vm filesys
TAR_PATH := team${TEAM}.tar.gz
all::
@echo "Run 'make' in subdirectories: $(BUILD_SUBDIRS)."
@echo "This top-level make has only 'clean' targets."
CLEAN_SUBDIRS = $(BUILD_SUBDIRS)
clean::
for d in $(CLEAN_SUBDIRS); do $(MAKE) -C $$d $@; done
rm -f TAGS tags
rm -f *.tar.gz
distclean:: clean
find . -name '*~' -exec rm '{}' \;
TAGS_SUBDIRS = $(BUILD_SUBDIRS) devices lib include
TAGS_SOURCES = find $(TAGS_SUBDIRS) -name \*.[chS] -print
TAGS::
etags `$(TAGS_SOURCES)`
tags::
ctags `$(TAGS_SOURCES)`
cscope.files::
$(TAGS_SOURCES) > cscope.files
cscope:: cscope.files
cscope -b -q -k
archive:: clean
ifeq ($(shell echo ${TEAM} | egrep "^[1-9]{1}[0-9]{0,2}$$"),)
@echo "Check your team number: $(TEAM)"
else
@tar -zcf /tmp/${TAR_PATH} . && \
mv /tmp/${TAR_PATH} . && \
echo "Successfully archived. Submit '${TAR_PATH}'."
endif