-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 861 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 861 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
TARGET=libcj.so
BUILDDIR=bin/
PREFIX=/usr/local/lib/
SOURCES=$(wildcard src/*.c src/arch/*.c src/arch/*/*.c)
override CFLAGS+=-std=c11 -O2 -Wno-gnu
LDFLAGS+=-shared
DEVFLAGS=-Werror -Wall -g -fPIC -DNDEBUG -Wfloat-equal -Wundef -Wwrite-strings -Wuninitialized -pedantic -O0
.PHONY: all codegen dev example demo clean install uninstall
all:
mkdir -p $(BUILDDIR)
$(CC) $(SOURCES) -o $(BUILDDIR)$(TARGET) $(CFLAGS) $(LDFLAGS)
codegen: codegen_x86 codegen_arm64
codegen_x86:
@echo "Generating x86-64 backend..."
node codegen/x86_encoder.js
codegen_arm64:
@echo "Generating ARM64 backend..."
node codegen/arm64_encoder.js
dev:
mkdir -p $(BUILDDIR)
$(CC) $(SOURCES) -o $(BUILDDIR)$(TARGET) $(CFLAGS) $(DEVFLAGS) $(LDFLAGS)
install: all
install $(BUILDDIR)$(TARGET) $(PREFIX)$(TARGET)
uninstall:
rm -rf $(PREFIX)$(TARGET)
clean:
rm -rf $(BUILDDIR)