-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 707 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (28 loc) · 707 Bytes
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
CC = g++
OUTPUTS = input_generator$(EXE) code1$(EXE) code2$(EXE) compare$(EXE)
SOURCES = input_generator.cpp code1.cpp code2.cpp compare.cpp
INPUT_FILE = input.txt
OUTPUT1 = output1.txt
OUTPUT2 = output2.txt
ifeq ($(OS),Windows_NT)
RM = del
EXE = .exe
SLASH = /
else
RM = rm -f
EXE =
SLASH = /
endif
all: $(OUTPUTS)
input_generator$(EXE): input_generator.cpp
$(CC) -o $@ $<
code1$(EXE): code1.cpp
$(CC) -o $@ $<
code2$(EXE): code2.cpp
$(CC) -o $@ $<
compare$(EXE): compare.cpp
$(CC) -o $@ $<
run:
.$(SLASH)input_generator$(EXE) && .$(SLASH)code1$(EXE) < $(INPUT_FILE) > $(OUTPUT1) && .$(SLASH)code2$(EXE) < $(INPUT_FILE) > $(OUTPUT2) && .$(SLASH)compare$(EXE)
clean:
$(RM) $(OUTPUTS)