--- /dev/null
+CC?=gcc
+AR?=ar
+CFLAGS?=-O3 -Werror -Wall -Wextra
+PYTHON?=python3
+
+
+GENS:=\
+ svp64-dis-gen.c \
+ svp64-opc-gen.c \
+
+SRCS:=$(GENS)
+
+OBJS:=\
+ svp64-dis-gen.o \
+ svp64-opc-gen.o \
+
+
+.SUFFIX: .so .a .o .c
+
+
+.PHONY: all
+all: build
+
+
+.PHONY: build
+build: libsvp64.so
+
+
+.PHONY: clean
+clean:
+ rm -f $(GENS)
+ rm -f $(OBJS)
+ rm -f libsvp64.so
+ rm -f libsvp64.a
+
+
+libsvp64.so: libsvp64.a
+ $(CC) -fPIC -shared -o $@ -L. -Wl,--whole-archive libsvp64.a -Wl,--no-whole-archive
+
+
+libsvp64.a: $(OBJS)
+ $(AR) rcs $@ $^
+
+
+ $(GENS): codegen.py
+ SILENCELOG=true $(PYTHON) codegen.py $@ > $@
+
+
+.c.o:
+ $(CC) $(CFLAGS) -fPIC -c $< -o $@