-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
29 lines (23 loc) · 826 Bytes
/
makefile
File metadata and controls
29 lines (23 loc) · 826 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
CC=gcc
CFLAGS=-I/src/include
TESTTEMPFOLDER=tmp-test
.PHONY: help
sqlDocExtractor: src/main.c ## build the project
mkdir -p dist
$(CC) $(CFLAGS) src/include/*.c src/main.c -o dist/sqlDocExtractor
help:
@echo
@echo "make targets :"
@echo
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' \
| sed -e 's/\[32m##/[33m/'
@echo
test: sqlDocExtractor test/* ## run unit tests
mkdir -p $(TESTTEMPFOLDER)
for test_dir in $(shell ls test); do \
./dist/sqlDocExtractor test/$${test_dir}/test-file.sql > $(TESTTEMPFOLDER)/$${test_dir}.json ; \
diff test/$${test_dir}/expected-output.json $(TESTTEMPFOLDER)/$${test_dir}.json || echo "\nFAIL: $${test_dir}\n" ; \
done
clean: ## remove output files
rm -r dist/ $(TESTTEMPFOLDER)