diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:03:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:03:55 +0300 |
| commit | 191eaea25cf569ad9c5fb12b8755ae6400750e58 (patch) | |
| tree | a0cd14f4a772da01b445355eb35eec54616d01ec /Makefile | |
| download | gran-191eaea25cf569ad9c5fb12b8755ae6400750e58.tar.gz gran-191eaea25cf569ad9c5fb12b8755ae6400750e58.zip | |
initial
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..32bae41 --- /dev/null +++ b/Makefile @@ -0,0 +1,61 @@ +DO != echo -n > deps.mk + +DEBUGFLAGS != [ $(RELEASE) ] && echo "-flto=auto -O2 -g -DNODEBUG" || echo "-O0 -g -DDEBUG" +CFLAGS = -Wall -Wextra -fopenmp +DEPFLAGS = -MT $@ -MMD -MP -MF $@.d +INCLUDEFLAGS = -Iinclude +COMPILEFLAGS = +LINKFLAGS = + +all: gran + +# default values +CROSS_COMPILE ?= + +# common programs +CC = gcc + +SOURCES := + +include src/source.mk + +COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\ + $(CFLAGS) $(DEPFLAGS) $(COMPILEFLAGS) $(INCLUDEFLAGS) + +OBJS != ./scripts/gen-deps --sources "$(SOURCES)" +MAIN_OBJ != ./scripts/gen-deps --sources "$(MAIN_SRC)" + +include tests/source.mk +include deps.mk + +.PHONY: format +format: + @cd src; find . -iname '*.[ch]' |\ + xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F - + @cd include; find . -iname '*.[ch]' |\ + xargs -n 10 -P 0 uncrustify -c ../uncrustify.conf --no-backup -F - + +.PHONY: license +license: + @find . -iname '*.[ch]' |\ + xargs -n 10 -P 0 ./scripts/license + +.PHONY: docs +docs: + @./scripts/warn-undocumented + @doxygen docs/doxygen.conf + +.PHONY: check +check: $(TEST_PROGS) + ./tests/check.sh + +gran: $(MAIN_OBJ) $(OBJS) + $(COMPILE) $(MAIN_OBJ) $(OBJS) -o $@ + +.PHONY: clean +clean: + @$(RM) -r build gran deps.mk + +.PHONY: clean_docs +clean_docs: + @$(RM) -r docs/output |
