forked from panda-re/hypernvram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 652 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 652 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
ARCH ?= x86_64
TARGETS = libnvram-$(ARCH).so cli_example-$(ARCH) hc_test-$(ARCH)
CFLAGS ?=
.PHONY: all clean
ifeq ($(ARCH),mipsel-unknown-linux-musl)
CFLAGS += -mips32r3
else ifeq ($(ARCH),mips-unknown-linux-musl)
CFLAGS += -mips32r3
else ifeq ($(ARCH),mips64-unknown-linux-muslabi64)
CFLAGS += -mips64r2
else ifeq ($(ARCH),mips64el-unknown-linux-muslabi64)
CFLAGS += -mips64r2
endif
all: $(TARGETS)
libnvram-$(ARCH).so: nvram.c
$(CC) $(CFLAGS) -fPIC -shared -nostdlib $< -o $@
hc_test-$(ARCH): hc_test.c
$(CC) $(CFLAGS) -static $< -o $@
cli_example-$(ARCH): cli_example.c
$(CC) $(CFLAGS) -L. -lnvram-$(ARCH) $< -o $@
clean:
rm -f $(TARGETS)