|
| 1 | +# Copyright (c) 2016 The Khronos Group Inc. |
| 2 | +# |
| 3 | +# Permission is hereby granted, free of charge, to any person obtaining a |
| 4 | +# copy of this software and/or associated documentation files (the |
| 5 | +# "Materials"), to deal in the Materials without restriction, including |
| 6 | +# without limitation the rights to use, copy, modify, merge, publish, |
| 7 | +# distribute, sublicense, and/or sell copies of the Materials, and to |
| 8 | +# permit persons to whom the Materials are furnished to do so, subject to |
| 9 | +# the following conditions: |
| 10 | +# |
| 11 | +# The above copyright notice and this permission notice shall be included |
| 12 | +# in all copies or substantial portions of the Materials. |
| 13 | +# |
| 14 | +# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 15 | +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 | +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 | +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 18 | +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 19 | +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 20 | +# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 21 | + |
| 22 | +OPENVX_INSTALL_DIR ?= /home/openvx/openvx_sample/install/Linux/x64/Release |
| 23 | +IDIRS ?= /usr/include $(OPENVX_INSTALL_DIR)/include |
| 24 | + |
| 25 | +CPP_FILES = $(wildcard *.cpp) |
| 26 | + |
| 27 | +ODIR = obj |
| 28 | +OBJ_FILES = $(CPP_FILES:.cpp=.o) |
| 29 | +OBJ = $(patsubst %,$(ODIR)/%,$(OBJ_FILES)) |
| 30 | + |
| 31 | +LDIRS = $(OPENVX_INSTALL_DIR)/bin |
| 32 | +LIBS = m openvx vxu opencv_highgui opencv_imgproc opencv_core |
| 33 | + |
| 34 | +TARGET = easy_exercise1 |
| 35 | + |
| 36 | +CC = g++ |
| 37 | +CFLAGS = -g |
| 38 | + |
| 39 | +$(TARGET) : $(OBJ) |
| 40 | + $(CC) -o $@ $^ $(CFLAGS) -Wl,-rpath,$(OPENVX_INSTALL_DIR)/bin \ |
| 41 | + $(patsubst %,-L%,$(LDIRS)) $(patsubst %,-l%,$(LIBS)) |
| 42 | + |
| 43 | +$(ODIR)/%.o: %.cpp |
| 44 | + @mkdir -p $(ODIR) |
| 45 | + $(CC) -c $(patsubst %,-I%,$(IDIRS)) -o $@ $< $(CFLAGS) |
| 46 | + |
| 47 | +clean : |
| 48 | + rm -rf $(ODIR) |
| 49 | + rm -f $(TARGET) |
0 commit comments