# Copyright (c) 2015-2019, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.

include ../../../../make/nvdefs.mk

TARGETS = libnv_extimgdev

CFLAGS   = $(NV_PLATFORM_OPT) $(NV_PLATFORM_CFLAGS)
CFLAGS  += -I.
CFLAGS  += -I../../utils
CFLAGS  += -I../drv
CFLAGS  += -I./maxim
CFLAGS  += -I./tpg
CFLAGS  += -D_FILE_OFFSET_BITS=64
CFLAGS  += -fPIC
ifeq ($(NV_PLATFORM_OS), QNX)
  CFLAGS += -DNVMEDIA_QNX
endif

CPPFLAGS = $(NV_PLATFORM_SDK_INC) $(NV_PLATFORM_CPPFLAGS)

OBJS   += dev.o
OBJS   += dev_list.o
OBJS   += dev_map.o
OBJS   += dev_property.o
OBJS   += maxim/ref_max9286_96705_ar0231_rccb.o
OBJS   += maxim/ref_max96712_96705_ar0231_rccb.o
OBJS   += maxim/ref_max96712_96705_ar0144.o
OBJS   += maxim/ref_max96712_96759_constellation.o
OBJS   += maxim/ref_max96712_tpg.o
OBJS   += maxim/common_max96712.o
OBJS   += tpg/tpg.o
OBJS   += ../drv/isc_max9271.o
OBJS   += ../drv/isc_max96705.o
OBJS   += ../drv/isc_max96759.o
OBJS   += ../drv/isc_max9286.o
OBJS   += ../drv/isc_max96712.o
OBJS   += ../drv/isc_ar0231_rccb.o
OBJS   += ../drv/isc_ar0144.o
OBJS   += ../drv/isc_constellation.o
OBJS   += ../drv/isc_n24c64.o
OBJS   += ../../utils/chip_util.o
OBJS   += ../../utils/log_utils.o

LDLIBS += -lnvmedia_isc

$(TARGETS).so: $(OBJS)
	$(CROSSBIN)ld -shared --soname $(TARGETS).so $^ -o $@ -L $(LDLIBS)
	$(AR) rcs $(TARGETS).a $@ $^

clean clobber:
	rm -rf $(OBJS) $(TARGETS).so $(TARGETS).a
