diff options
Diffstat (limited to 'tools/bin2carr/Makefile')
-rw-r--r-- | tools/bin2carr/Makefile | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tools/bin2carr/Makefile b/tools/bin2carr/Makefile deleted file mode 100644 index a9ff816..0000000 --- a/tools/bin2carr/Makefile +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | .POSIX: | ||
2 | .SUFFIXES: | ||
3 | |||
4 | # Source code location and files to watch for changes. | ||
5 | SRC_DIR := src | ||
6 | SRC_MAIN := $(SRC_DIR)/main.c | ||
7 | WATCH_SRC := $(wildcard $(SRC_DIR)/*.c) | ||
8 | WATCH_SRC += $(wildcard $(SRC_DIR)/*.h) | ||
9 | |||
10 | # Output library names and executables. | ||
11 | BIN_NAME := bin2carr | ||
12 | BUILD_DIR := build | ||
13 | BIN := $(BUILD_DIR)/$(BIN_NAME) | ||
14 | |||
15 | # Compiler and linker configuration. | ||
16 | CC := gcc | ||
17 | CFLAGS := -Wall -Wextra -pedantic -std=c99 -DBIN_NAME=\"$(BIN_NAME)\" | ||
18 | LDFLAGS := -lm | ||
19 | LDLIBS := | ||
20 | RELEASE_CFLAGS := -DNDEBUG -O2 | ||
21 | DEBUG_CFLAGS := -DDEBUG -g | ||
22 | |||
23 | .PHONY: static clean run | ||
24 | |||
25 | # Setup debug/release builds. | ||
26 | # make clean && make <target> DEBUG=0 | ||
27 | # make clean && make <target> DEBUG=1 | ||
28 | DEBUG ?= 0 | ||
29 | ifeq ($(DEBUG), 1) | ||
30 | CFLAGS += $(DEBUG_CFLAGS) | ||
31 | else | ||
32 | CFLAGS += $(RELEASE_CFLAGS) | ||
33 | endif | ||
34 | |||
35 | static: $(BUILD_DIR) $(BIN) | ||
36 | |||
37 | $(BIN): $(SRC_MAIN) $(WATCH_SRC) | ||
38 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(SRC_MAIN) $(LDLIBS) | ||
39 | |||
40 | $(BUILD_DIR): | ||
41 | mkdir -p $(BUILD_DIR) | ||
42 | |||
43 | run: $(BIN) | ||
44 | exec $(BIN) | ||
45 | |||
46 | clean: | ||
47 | rm -r $(BUILD_DIR) | ||