# SPDX-License-Identifier: LicenseRef-Unisoc-General-1.0
#
# Copyright 2023 Unisoc (Shanghai) Technologies Co., Ltd
#
# Licensed under the Unisoc General Software License, version 1.0 (the License);
# you may not use this file except in compliance with the License. You may obtain a copy of the License at
#
# https://www.unisoc.com/en_us/license/UNISOC_GENERAL_LICENSE_V1.0-EN_US
#
# Software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OF ANY KIND, either express or implied.
# See the Unisoc General Software License, version 1.0 for more details.

# makefile for gnss-ota
CFLAGS = -Wall -g -O -std=c++17

TARGET = gnss-demo

INCLUDE_DIRS = -I ./inc/

SYS_ROOT = $(WORKDIR)/recipe-sysroot

INCLUDE_DIRS += \
		-I$(SYS_ROOT)/usr/include \
        -I$(SYS_ROOT)/usr/include/dbus-1.0 \
        -I$(SYS_ROOT)/usr/lib/dbus-1.0/include

LIBS = -lpthread -ldbus-1

#remove later
SRCS := $(wildcard ./src/*.cpp)
OBJS := $(notdir $(patsubst %.cpp,%.o,$(SRCS)))

all:$(OBJS)
	$(CXX) -o $(TARGET) $(OBJS) $(LIBS)

$(OBJS):$(SRCS)
	$(CXX) $(CFLAGS) $(INCLUDE_DIRS) -c $^

install:
	@echo "gnss demo install do nothing"
clean:
	rm -f $(OBJS)
	rm -f $(TARGET)