-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (35 loc) · 1.05 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
41
42
43
44
45
46
47
48
# CS 111 Lab 1 Makefile
CC = gcc
CFLAGS = -g -Wall -Wextra -Wno-unused -Werror
LAB = 1
DISTDIR = lab1-$(USER)
all: timetrash
TESTS = $(wildcard test*.sh)
TEST_BASES = $(subst .sh,,$(TESTS))
TIMETRASH_SOURCES = \
alloc.c \
execute-command.c \
main.c \
read-command.c \
print-command.c
TIMETRASH_OBJECTS = $(subst .c,.o,$(TIMETRASH_SOURCES))
DIST_SOURCES = \
$(TIMETRASH_SOURCES) alloc.h command.h command-internals.h Makefile \
$(TESTS) check-dist README
timetrash: $(TIMETRASH_OBJECTS)
$(CC) $(CFLAGS) -o $@ $(TIMETRASH_OBJECTS)
alloc.o: alloc.h
execute-command.o main.o print-command.o read-command.o: command.h
execute-command.o print-command.o read-command.o: command-internals.h
dist: $(DISTDIR).tar.gz
$(DISTDIR).tar.gz: $(DIST_SOURCES) check-dist
rm -fr $(DISTDIR)
tar -czf [email protected] --transform='s,^,$(DISTDIR)/,' $(DIST_SOURCES)
./check-dist $(DISTDIR)
mv [email protected] $@
check: $(TEST_BASES)
$(TEST_BASES): timetrash
clean:
rm -fr *.o *~ *.bak *.tar.gz core *.core *.tmp timetrash $(DISTDIR)
.PHONY: all dist check $(TEST_BASES) clean