# 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 -fPIC

TARGET = sensordemo

LIBS = -lpthread -lrt -lsensorhelper

DIR_ROOT = ${SYS_ROOT}/recipe-sysroot

INCLUDES = -I. \
	   -I ./include \
	   -I$(DIR_ROOT)/usr/include 

SRCS := $(wildcard *.c)

FILES := $(notdir $(SRCS))

OBJS = $(patsubst %c,%o,$(FILES))

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

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

install:
	cp $(TARGET) /usr/bin

uninstall:
	rm -f /usr/bin/$(notdir $(TARGET))

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

