1# libiio - Library for interfacing industrial I/O (IIO) devices
2#
3# Copyright (C) 2014 Analog Devices, Inc.
4# Author: Paul Cercueil <paul.cercueil@analog.com>
5#
6# This library is free software; you can redistribute it and/or
7# modify it under the terms of the GNU Lesser General Public
8# License as published by the Free Software Foundation; either
9# version 2.1 of the License, or (at your option) any later version.
10#
11# This library is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14# Lesser General Public License for more details.
15
16
17TARGETS := ad9361-iiostream ad9371-iiostream dummy-iiostream iio-monitor
18
19CFLAGS = -Wall
20
21UNAME_S := $(shell uname -s)
22
23ifeq ($(UNAME_S),Darwin)
24	CFLAGS += -framework iio
25else
26	LDFLAGS += -liio
27endif
28
29.PHONY: all clean
30
31all: $(TARGETS)
32
33iio-monitor: iio-monitor.o
34	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) -lpthread -lncurses -lcdk
35
36ad9361-iiostream : ad9361-iiostream.o
37	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
38
39ad9371-iiostream : ad9371-iiostream.o
40	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
41
42dummy-iiostream : dummy-iiostream.o
43	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
44
45clean:
46	rm -f $(TARGETS) $(TARGETS:%=%.o)
47