forked from SEForAll/sefa_classroom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (47 loc) · 3 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
56
57
58
59
60
61
# variables to change (marked inside <>):
# NNN = name of the excutable. ex) hw01
# Input arguments = Name of all the input arguments, seperate by space. Do not include any pass, just put in the file name. ex) -b input1 input2
# Name of Outputfiles = Name of all the output files, seperate by space. Do not include any pass, just put in the file name. ex) output1 output2
# Name of one of the outputfiles = Name of one of the outputfiles. Do not include any pass, just put in the file name. ex) output1
# Name of one of the expected outputfiles = Name of one of the expected outputfiles. Do not include any pass, just put in the file name. ex) expected1
#
# Replace any <...> with the correct code. Follow the instruction specified above and at the end of this makefile. You must not modify anything else, unless you fully understand
# how out system works in detail.
WARNING = -Wall -Wshadow --pedantic
ERROR = -Wvla -Werror
GCC = gcc -std=c99 -g $(WARNING) $(ERROR)
TESTFALGS = <need input!!!> # Need modification ex) -DTEST_COUNTWORD -DDEBUG
SRCS = <need input!!!> # Need modification ex) main.c list.c
OBJS = $(SRCS:%.c=%.o)
VAL = valgrind --tool=memcheck --log-file=memcheck.txt --leak-check=full --verbose
<NNN>: $(OBJS) # Need modification
$(GCC) $(TESTFALGS) $(OBJS) -o <NNN>
.c.o:
$(GCC) $(TESTFALGS) -c $*.c
test1: <NNN> # Need modification
./ <NNN> <Input arguments> <Name of Output files>
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> > grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
test2: <NNN> # Need modification
./ <NNN> <Input arguments> <Name of Output files>
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> > grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
test3: <NNN> # Need modification
./ <NNN> <Input arguments> <Name of Output files>
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> > grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
diff <Name of one of the outputfiles> <Name of one of the expected outputfiles> >> grade.txt
clean: # remove all machine generated files # Need modification
rm -f <NNN> *.o output?
# If you need more test cases, create more test cases below with the same format as above.
# You can have as many diff statement as you want.
# If the program output its output to the sdtout, use the template for testcases below.
#
# test5: <NNN> # Need modification
# ./ <NNN> <Input arguments> > out.txt
# diff out.txt <Name of one of the expected output files> > grade.txt
#
#
#