# Copyright (c) 2022 by UNISOC Technology (Shanghai), Inc.  ALL RIGHTS RESERVED.
#
# These coded instructions, statements, and computer programs are the
# copyrighted works and confidential proprietary information of
# UNISOC Technology (Shanghai), Inc. They may not be modified, copied, reproduced,
# distributed, or disclosed to third parties in any manner, medium, or form,
# in whole or in part, without the prior written consent of UNISOC Technology (Shanghai), Inc.

CFLAGS = -Wall -g -O

TARGET = ledtest

INCLUDES = -I. \
	   $(shell pkg-config --cflags)

LIBS = -lpthread -lrt -lled-client

SRCS := $(wildcard *.c)

FILES := $(notdir $(SRCS))
$(info VAR="$(SRCS)")

OBJS = $(patsubst %c,%o,$(FILES))
$(info VAR="$(OBJS)")

all:$(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $(TARGET) $(OBJS) $(LIBS)

$(OBJS):$(SRCS)
	$(CC) $(CFLAGS) $(INCLUDES) -c $^

install:
	cp $(TARGET) $(INSTALL_MOD_PATH)/usr/bin

clean:
	rm -f *.o
	rm -f $(TARGET)
