blob: 7bbbad48874f37b352382c2df942ed5cb1addf73 [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
CFLAGS += -Wall -Wextra -Werror
LIBDIR = /usr/lib
SBINDIR = /usr/sbin
LIBQMI_SRCS = \
dev.c \
file.c \
mock.c \
poller.c \
qmi.c \
qmictl.c \
qmidev.c \
qmimsg.c \
util.c
UNITTESTS = \
qmidev_unittest
PC_CFLAGS := $(shell pkg-config --cflags glib-2.0)
CFLAGS += -fpic -I ../include $(PC_CFLAGS)
PC_LIBS := $(shell pkg-config --libs glib-2.0)
LDLIBS += $(PC_LIBS)
LIBQMI_OBJS = $(LIBQMI_SRCS:.c=.o)
LINK.c = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
all: libqmi.so get_cid_stress_test
libqmi.so: LDFLAGS += -Wl,-soname,libqmi.so -shared
libqmi.so: $(LIBQMI_OBJS)
$(LINK.c)
test: $(UNITTESTS)
./qmidev_unittest
qmidev_unittest: $(LIBQMI_OBJS) qmidev_unittest.o
$(LINK.c)
get_cid_stress_test: LDLIBS += libqmi.so
get_cid_stress_test: get_cid_stress_test.o | libqmi.so
$(LINK.c)
install:
install -d $(DESTDIR)$(LIBDIR)
install -m755 libqmi.so $(DESTDIR)$(LIBDIR)
install -d $(DESTDIR)$(SBINDIR)
install -m755 get_cid_stress_test $(DESTDIR)$(SBINDIR)
clean:
rm -f *.o libqmi.so $(UNITTESTS) get_cid_stress_test