summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 19:42:33 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 19:42:33 +0200
commitf51b079da473cc07360503f8239c68b4a7eced9a (patch)
tree9185a40d2c0bdc5a0fcb9a138ddc5f577c2bc040
parentb1e8b4f24927efc6ed68420e4f579fb20ab831a9 (diff)
build: Add Makefile to build pipa examples
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rw-r--r--examples/Makefile10
3 files changed, 15 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ec8e003..4354aa8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ pipac
build
*.o
test/*_test
+examples/*.bin
diff --git a/Makefile b/Makefile
index 3963be1..c6d1289 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,10 @@ linter-fix: $(SRCS) $(HEADERS)
clang-format -i $?
$(MAKE) -C test linter-fix
+.PHONY: examples
+examples:
+ $(MAKE) -C examples
+
.PHONY: test
test: $(TARGET)
$(MAKE) -C test
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..0748662
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,10 @@
+SRCS := $(wildcard *.pipa)
+BINS := $(patsubst %.pipa, %.bin, $(SRCS))
+
+.PHONY: all
+all: $(BINS)
+
+%.bin: %.pipa
+ ../pipa --out $@ $<
+clean:
+ $(RM) $(BINS)