-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 780 Bytes
/
Makefile
File metadata and controls
37 lines (27 loc) · 780 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
34
35
36
37
# Copyright (C) 2026 p1k0chu
# SPDX-License-Identifier: GPL-3.0-or-later
CFLAGS += -Wall -Wextra -MMD -iquote ./include -std=gnu23 \
-Werror=implicit-int -Wconversion \
-Werror=implicit-fallthrough
SRCS := mtime.c object.c utils.c target.c compile.c \
compilemyself.c filename.c custom_target.c pkgconfig.c
OUT_STATIC := libcbuild.a
OUT_SHARED := libcbuild.so
objs = $(SRCS:.c=.o)
dep = $(SRCS:.c=.d)
shared: $(OUT_SHARED)
static: $(OUT_STATIC)
.PHONY: static shared
all: static shared
.PHONY: all
$(OUT_STATIC): $(objs)
$(AR) rcs $@ $^
$(OUT_SHARED): $(objs)
$(CC) $^ $(LDFLAGS) $(LDLIBS) $(CFLAGS) -shared -o $@
-include $(dep)
clean:
-$(RM) -v $(OUT_STATIC) $(OUT_SHARED) $(objs) $(dep)
.PHONY: clean
clean-objs:
-$(RM) -v $(objs) $(dep)
.PHONY: clean-objs