1# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5PKG_CONFIG ?= pkg-config 6DEP_LIBS = libchrome-$(BASE_VER) libyuv 7CXXFLAGS += $(shell $(PKG_CONFIG) --cflags $(DEP_LIBS)) -std=c++11 8 9LDFLAGS = -lrt -ldl -ljpeg 10LDFLAGS += $(shell $(PKG_CONFIG) --libs $(DEP_LIBS)) 11 12LDFLAGS_UNITTEST = -lrt 13LDFLAGS_UNITTEST += $(shell $(PKG_CONFIG) --libs $(DEP_LIBS)) 14 15LDFLAGS_HELPER = -lrt 16 17SRC = \ 18 camera_characteristics.cc \ 19 media_v4l2_device.cc \ 20 media_v4l2_test.cc 21 22SRC_UNITTEST = \ 23 camera_characteristics.cc \ 24 media_v4l2_device.cc \ 25 media_v4l2_unittest.cc 26 27SRC_HELPER = \ 28 media_v4l2_device.cc \ 29 media_v4l2_is_capture_device.cc 30 31TARGET = ../media_v4l2_test 32 33TARGET_UNITTEST = ../media_v4l2_unittest 34 35TARGET_HELPER = ../media_v4l2_is_capture_device 36 37all: $(TARGET) $(TARGET_UNITTEST) $(TARGET_HELPER) 38 39$(TARGET): $(SRC) 40 $(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS) 41 42$(TARGET_UNITTEST): $(SRC_UNITTEST) 43 $(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS_UNITTEST) 44 45$(TARGET_HELPER): $(SRC_HELPER) 46 $(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS_HELPER) 47 48clean: 49 $(RM) $(TARGET) 50 $(RM) $(TARGET_UNITTEST) 51 $(RM) $(TARGET_HELPER) 52