-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
30 lines (24 loc) · 742 Bytes
/
makefile
File metadata and controls
30 lines (24 loc) · 742 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
BINARY = datatape
.PHONY: all build test clean
all: build test
build: $(BINARY)
$(BINARY): *.go
@echo "Building..."
go build -o $(BINARY) .
test: build input.txt
@echo "Testing encode..."
./$(BINARY) -encode -input input.txt -output output.wav
@echo "Testing decode..."
./$(BINARY) -decode -input output.wav -output recovered.txt
@echo "Comparing files..."
@if cmp -s input.txt recovered.txt; then \
echo "✓ SUCCESS: Files match!"; \
else \
echo "✗ FAILURE: Files differ"; \
diff input.txt recovered.txt; \
fi
@echo "Original: $$(wc -c < input.txt) bytes"
@echo "Audio: $$(wc -c < output.wav) bytes"
@echo "Recovered: $$(wc -c < recovered.txt) bytes"
clean:
rm -f $(BINARY) input.txt output.wav recovered.txt