]> sigrok.org Git - libserialport.git/blobdiff - examples/Makefile
Add examples directory with two example programs.
[libserialport.git] / examples / Makefile
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644 (file)
index 0000000..c9ac40f
--- /dev/null
@@ -0,0 +1,16 @@
+CC = gcc
+PKG_CONFIG = pkg-config
+CFLAGS = -g -Wall $(shell $(PKG_CONFIG) --cflags libserialport)
+LIBS = $(shell $(PKG_CONFIG) --libs libserialport)
+
+SOURCES = $(wildcard *.c)
+
+BINARIES = $(SOURCES:.c=)
+
+%: %.c
+       $(CC) $(CFLAGS) $< $(LIBS) -o $@
+
+all: $(BINARIES)
+
+clean:
+       rm $(BINARIES)