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