liboppc: introduce simple check oppc
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 17 Jan 2024 15:28:34 +0000 (18:28 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Wed, 17 Jan 2024 15:28:34 +0000 (18:28 +0300)
src/liboppc/.gitignore [new file with mode: 0644]
src/liboppc/Makefile [new file with mode: 0644]

diff --git a/src/liboppc/.gitignore b/src/liboppc/.gitignore
new file mode 100644 (file)
index 0000000..2809ef0
--- /dev/null
@@ -0,0 +1,2 @@
+oppc.o
+oppc.c
diff --git a/src/liboppc/Makefile b/src/liboppc/Makefile
new file mode 100644 (file)
index 0000000..4fa2dc9
--- /dev/null
@@ -0,0 +1,36 @@
+CC?=gcc
+CFLAGS?=-O0 -g -Werror -Wall -Wextra
+PYTHON?=python3
+
+
+GENS:=oppc.c
+SRCS:=$(GENS)
+OBJS:=oppc.o
+
+
+.SUFFIX: .so .a .o .c
+
+
+.PHONY: all
+all: build
+
+
+.PHONY: build
+build: $(OBJS)
+
+
+.PHONY: clean
+clean:
+       rm -f $(GENS)
+       rm -f $(OBJS)
+
+
+oppc.o: oppc.c
+
+
+oppc.c:
+       $(PYTHON) -m openpower.oppc > $@
+
+
+.c.o:
+       $(CC) $(CPPFLAGS) -I. $(CFLAGS) -std=c11 -fPIC -c $< -o $@