• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1CXX ?= g++
2AR ?= ar
3RANLIB ?= ranlib
4CPPFLAGS += -I../include -I./include
5CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
6CXXFLAGS += -fPIC -Wall
7RMIDEVICESRC = rmifunction.cpp rmidevice.cpp hiddevice.cpp util.cpp
8RMIDEVICEOBJ = $(RMIDEVICESRC:.cpp=.o)
9LIBNAME = librmidevice.so
10STATIC_LIBNAME = librmidevice.a
11LDFLAGS = -shared -Wl,-soname,$(LIBNAME)
12
13all: $(LIBNAME) $(STATIC_LIBNAME)
14
15$(LIBNAME): $(RMIDEVICEOBJ)
16	$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@
17
18$(STATIC_LIBNAME): $(RMIDEVICEOBJ)
19	$(AR) crv $(STATIC_LIBNAME) $^
20	$(RANLIB) $(STATIC_LIBNAME)
21
22clean:
23	rm -f $(RMIDEVICEOBJ) $(LIBNAME)* $(STATIC_LIBNAME)*
24