aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2635da2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+NAME = clak
+PREFIX = $(HOME)/.local
+
+BOARDS = mxblue quack
+
+CC = gcc
+CFLAGS += -std=c99 -Wall -Wextra -Wshadow -Werror -pedantic
+LDLIBS = -lWinmm
+
+BOARD_FILES = $(addsuffix /board.h,$(addprefix board/,$(BOARDS)))
+
+default: $(NAME)
+
+$(NAME): $(NAME).c $(BOARD_FILES) board/boards.h
+ $(CC) $(CFLAGS) $(NAME).c $(LDLIBS) -o $(NAME)
+
+board/boards.h:
+ printf "#ifndef BOARD_DEFAULTS_H\n#define BOARD_DEFAULTS_H\n\n" > board/boards.h
+ for board in $(BOARDS); do echo "#include \"$$board/board.h\"" >> board/boards.h; done
+ printf "\n#endif /* BOARD_DEFAULTS_H */" >> board/boards.h
+
+$(BOARD_FILES): %.h: %_down.wav
+ xxd -i "$<" "$@"
+
+clean:
+ rm -f *.o
+ rm -f $(NAME)
+ rm -f board/boards.h
+ rm -f $(BOARD_FILES) \ No newline at end of file