-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (21 loc) · 728 Bytes
/
Makefile
File metadata and controls
33 lines (21 loc) · 728 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
30
31
32
33
VERSION = $(shell grep "^ *\.version = \"" build.zig.zon | sed 's/^.*\.version = //' | sed 's/,.*//')
CC = cc
CFLAGS = -Wall -luring -O2 -DVERSION=\"$(VERSION)\"
EXEC = lndir
SRC = src/main.c src/string_list.c src/lndir.c src/dir_walker.c
VERSION_FILE = build.zig.zon
MAKEFILE = Makefile
## Single compilation unit
$(EXEC): $(SRC) $(VERSION_FILE) $(MAKEFILE)
$(CC) $(SRC) $(CFLAGS) -o $@
## Seperate compilation units + linking
## A single CU compiles fast enough for now
# OBJ = $(SRC:.c=.o)
# %.o: %.c
# $(CC) -c $< -o $@
# $(EXEC): $(OBJ) $(VERSION_FILE) $(MAKEFILE)
# $(CC) $(OBJ) $(CFLAGS) -o $@
clean:
rm -rf $(OBJ) $(EXEC) $(BUILD_DIR)
clean_zig:
rm -rf $(OBJ) $(EXEC) $(BUILD_DIR) .zig-cache/ zig-out/