Files
2026-09-22 09:38:26 +08:00

40 lines
867 B
Makefile
Executable File

# SPDX-FileCopyrightText: 2022 Unisoc (Shanghai) Technologies Co., Ltd.
#
# SPDX-License-Identifier: LicenseRef-Unisoc-General-1.0
ifdef CROSS_COMPILE
CC = $(CROSS_COMPILE)gcc
endif
FLAGS = -Wall -g -O
FLAGS += -DPLATFORM_YOCTO
CFLAGS += -fPIC
TARGET := gnss-adapter
# makefile depend workdir
# WORKDIR needs to be assigned in the .bb
SYS_ROOT = $(WORKDIR)/recipe-sysroot
INCULED_FILE = -I$(SYS_ROOT)/usr/include \
-I$(SYS_ROOT)/usr/include/dbus-1.0 \
-I$(SYS_ROOT)/usr/lib/dbus-1.0/include
LIBS := -pthread -lutil -lgnssmgt -ldbus-1 -ldbushelper
SRCS := $(wildcard ./*.c)
OBJS := $(notdir $(patsubst %.c,%.o,$(SRCS)))
all:$(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(LIBS)
$(OBJS):$(SRCS)
$(CC) $(CFLAGS) $(FLAGS) $(INCULED_FILE) -c $^
install:
@echo "gnss-adapter install do nothing"
clean:
-rm *.o *.gcno
-rm -rf $(TARGET)