examples/Makefile
raw| 1 | # A simple Makefile to build the examples in this directory. |
| 2 | # |
| 3 | # This example file is released to the public domain. |
| 4 | |
| 5 | CC = gcc |
| 6 | PKG_CONFIG = pkg-config |
| 7 | CFLAGS = -g -Wall $(shell $(PKG_CONFIG) --cflags libserialport) |
| 8 | LIBS = $(shell $(PKG_CONFIG) --libs libserialport) |
| 9 | |
| 10 | SOURCES = $(wildcard *.c) |
| 11 | |
| 12 | BINARIES = $(SOURCES:.c=) |
| 13 | |
| 14 | %: %.c |
| 15 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ |
| 16 | |
| 17 | all: $(BINARIES) |
| 18 | |
| 19 | clean: |
| 20 | rm $(BINARIES) |