aboutsummaryrefslogtreecommitdiff
path: root/rmidevice/Makefile
blob: 35aec55229d11eb1ede63297fa05b20885acb1f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CXX ?= g++
AR ?= ar
RANLIB ?= ranlib
CPPFLAGS += -I../include -I./include
CXXFLAGS += -fPIC -Wall
RMIDEVICESRC = rmifunction.cpp rmidevice.cpp hiddevice.cpp
RMIDEVICEOBJ = $(RMIDEVICESRC:.cpp=.o)
LIBNAME = librmidevice.so
STATIC_LIBNAME = librmidevice.a
LDFLAGS = -shared -Wl,-soname,$(LIBNAME)

all: $(LIBNAME) $(STATIC_LIBNAME)

$(LIBNAME): $(RMIDEVICEOBJ)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@

$(STATIC_LIBNAME): $(RMIDEVICEOBJ)
	$(AR) crv $(STATIC_LIBNAME) $^
	$(RANLIB) $(STATIC_LIBNAME)

clean:
	rm -f $(RMIDEVICEOBJ) $(LIBNAME)* $(STATIC_LIBNAME)*