Home | History | Annotate | Download | only in src
      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++14 -DUNIT_TEST
      8 
      9 LDFLAGS = -lrt -ldl -Wl,-Bstatic -lgtest -Wl,-Bdynamic -ljpeg -lre2
     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 	media_v4l2_device.cc \
     24 	media_v4l2_unittest.cc
     25 
     26 SRC_HELPER = \
     27 	media_v4l2_device.cc \
     28 	media_v4l2_is_capture_device.cc
     29 
     30 TARGET = ../media_v4l2_test
     31 
     32 TARGET_UNITTEST = ../media_v4l2_unittest
     33 
     34 TARGET_HELPER = ../media_v4l2_is_capture_device
     35 
     36 all: $(TARGET) $(TARGET_UNITTEST) $(TARGET_HELPER)
     37 
     38 $(TARGET): $(SRC)
     39 	$(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS)
     40 
     41 $(TARGET_UNITTEST): $(SRC_UNITTEST)
     42 	$(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS_UNITTEST)
     43 
     44 $(TARGET_HELPER): $(SRC_HELPER)
     45 	$(CXX) $(CXXFLAGS) -O3 -o $@ $^ $(LDFLAGS_HELPER)
     46 
     47 clean:
     48 	$(RM) $(TARGET)
     49 	$(RM) $(TARGET_UNITTEST)
     50 	$(RM) $(TARGET_HELPER)
     51