-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (37 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
49
50
51
52
53
54
55
# Output binary name
bin=crash
lib=libshell.so
# Set the following to '0' to disable log messages:
LOGGER ?= 1
# Compiler/linker flags
CFLAGS += -g -Wall -fPIC -DLOGGER=$(LOGGER)
LDLIBS += -lm -lreadline
LDFLAGS += -L. -Wl,-rpath='$$ORIGIN'
src=history.c shell.c ui.c
obj=$(src:.c=.o)
all: $(bin) $(lib)
$(bin): $(obj)
$(CC) $(CFLAGS) $(LDLIBS) $(LDFLAGS) $(obj) -o $@
$(lib): $(obj)
$(CC) $(CFLAGS) $(LDLIBS) $(LDFLAGS) $(obj) -shared -o $@
shell.o: shell.c history.h logger.h ui.h
history.o: history.c history.h logger.h
ui.o: ui.h ui.c logger.h history.h
clean:
rm -f $(bin) $(obj) $(lib) vgcore.*
# Tests --
test_repo=usf-cs521-sp22/P3-Tests
test: $(all) ./.testlib/run_tests ./tests
@DEBUG="$(debug)" ./.testlib/run_tests $(run)
grade: ./.testlib/grade
./.testlib/grade $(run)
testupdate: testclean test
testclean:
rm -rf tests .testlib
./tests:
rm -rf ./tests
git clone https://github.com/$(test_repo) tests
./.testlib/run_tests:
rm -rf ./.testlib
git clone https://github.com/malensek/cowtest.git .testlib
./.testlib/grade: ./.testlib/run_tests