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 5 PKG_CONFIG ?= pkg-config 6 DEP_LIBS = libchrome-$(BASE_VER) libyuv 7 CXXFLAGS += $(shell $(PKG_CONFIG) --cflags $(DEP_LIBS)) -std=c++11 8 9 LDFLAGS = -lrt -ldl -ljpeg 10 LDFLAGS += $(shell $(PKG_CONFIG) --libs $(DEP_LIBS)) 11 12 LDFLAGS_UNITTEST = -lrt 13 LDFLAGS_UNITTEST += $(shell $(PKG_CONFIG) --libs $(DEP_LIBS)) 14 15 LDFLAGS_HELPER = -lrt 16 17 SRC = \ 18 camera_characteristics.cc \ 19 media_v4l2_device.cc \ 20 media_v4l2_test.cc 21 22 SRC_UNITTEST = \ 23 camera_characteristics.cc \ 24 media_v4l2_device.cc \ 25 media_v4l2_unittest.cc 26 27 SRC_HELPER = \ 28 media_v4l2_device.cc \ 29 media_v4l2_is_capture_device.cc 30 31 TARGET = ../media_v4l2_test 32 33 TARGET_UNITTEST = ../media_v4l2_unittest 34 35 TARGET_HELPER = ../media_v4l2_is_capture_device 36 37 all: $(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 48 clean: 49 $(RM) $(TARGET) 50 $(RM) $(TARGET_UNITTEST) 51 $(RM) $(TARGET_HELPER) 52