aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-03-07 02:18:26 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2023-03-07 02:18:26 +0200
commitae5fee63f160643a397d18e9e0658275606bc4d4 (patch)
treef68af302374f9ae3c9dbb28dab5547036252d559 /Makefile
downloadek-ae5fee63f160643a397d18e9e0658275606bc4d4.tar.gz
ek-ae5fee63f160643a397d18e9e0658275606bc4d4.zip
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 53 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f09849b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+DO != echo -n > deps.mk
+
+DEBUGFLAGS != [ $(RELEASE) ] && echo "-flto -O2 -DNODEBUG" || echo "-O0 -g -DDEBUG"
+CFLAGS = -Wall -Wextra
+DEPFLAGS = -MT $@ -MMD -MP -MF $@.d
+INCLUDEFLAGS = -Iinclude
+COMPILEFLAGS =
+LINKFLAGS =
+
+all: ct
+
+# 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)"
+
+include deps.mk
+
+.PHONY: format
+format:
+ @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
+
+ct: $(OBJS)
+ $(COMPILE) $(OBJS) -o $@
+
+.PHONY: clean
+clean:
+ @$(RM) -r build exgt deps.mk
+
+.PHONY: clean_docs
+clean_docs:
+ @$(RM) -r docs/output