1 CXX ?= g++ 2 CPPFLAGS += -I../include -I./include -I../rmidevice 3 CXXFLAGS += -Wall 4 LDFLAGS += -L. 5 LIBS = -lrmidevice 6 LIBDIR = ../rmidevice 7 LIBNAME = librmidevice.a 8 RMIHIDTOOLSRC = main.cpp 9 RMIHIDTOOLOBJ = $(RMIHIDTOOLSRC:.cpp=.o) 10 PROGNAME = rmihidtool 11 STATIC_BUILD ?= y 12 ifeq ($(STATIC_BUILD),y) 13 LDFLAGS += -static 14 endif 15 16 all: $(PROGNAME) 17 18 $(PROGNAME): $(RMIHIDTOOLOBJ) 19 $(CXX) $(CXXFLAGS) $(LDFLAGS) $(RMIHIDTOOLOBJ) -L$(LIBDIR) $(LIBS) -o $(PROGNAME) 20 21 clean: 22 rm -f $(RMIHIDTOOLOBJ) $(PROGNAME) 23