include version APPNAME = libmts-io SONAME = $(APPNAME).so.$(VERSION) libdir ?= /usr/lib OBJS += \ src/MTS_IO_TelitRadio.o \ src/MTS_IO_EG95Radio.o \ src/MTS_IO_QuectelRadio.o \ src/MTS_IO_CdmaRadio.o \ src/MTS_IO_CE910Radio.o \ src/MTS_IO_CellularRadio.o \ src/MTS_IO_ICellularRadio.o \ src/MTS_IO_CellularRadioFactory.o \ src/MTS_IO_Connection.o \ src/MTS_IO_DE910Radio.o \ src/MTS_IO_GE910Radio.o \ src/MTS_IO_HE910Radio.o \ src/MTS_IO_HE910DRadio.o \ src/MTS_IO_HE910EUDRadio.o \ src/MTS_IO_LE910JN1Radio.o \ src/MTS_IO_LE866Radio.o \ src/MTS_IO_LE866A1JSRadio.o \ src/MTS_IO_LE910Radio.o \ src/MTS_IO_LE910NAGRadio.o \ src/MTS_IO_LE910C4NFRadio.o \ src/MTS_IO_LE910NA1Radio.o \ src/MTS_IO_LE910SVGRadio.o \ src/MTS_IO_LE910SV1Radio.o \ src/MTS_IO_LE910EUGRadio.o \ src/MTS_IO_LE910C4EURadio.o \ src/MTS_IO_LE910EU1Radio.o \ src/MTS_IO_LE910C1NSRadio.o \ src/MTS_IO_LE910C1APRadio.o \ src/MTS_IO_ME910C1NARadio.o \ src/MTS_IO_ME910C1NVRadio.o \ src/MTS_IO_ME910C1WWRadio.o \ src/MTS_IO_ME910Radio.o \ src/MTS_IO_LockFile.o \ src/MTS_IO_MccMncTable.o \ src/MTS_IO_SerialConnection.o CC := $(CXX) CXXFLAGS += -Wall -Werror -std=c++0x -fmessage-length=0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden CPPFLAGS += -I=/usr/include/jsoncpp -Iinclude LDFLAGS += -s -shared -Wl,-soname,$(APPNAME).so.0 .PHONY: all clean install all: $(APPNAME).a $(SONAME) $(APPNAME).a: $(OBJS) $(AR) -rs $@ $? $(SONAME): $(OBJS) $(CC) $(LDFLAGS) -o $@ $+ $(LDLIBS) # Handle header dependencies DEPS = $(OBJS:.o=.d) CPPFLAGS += -MMD -include $(DEPS) install: mkdir -p $(DESTDIR)$(libdir) mkdir -p $(DESTDIR)$(includedir)/mts install -m 0644 $(APPNAME).a $(SONAME) $(DESTDIR)$(libdir)/ ln -sf $(SONAME) $(DESTDIR)$(libdir)/$(APPNAME).so.0 ln -sf $(SONAME) $(DESTDIR)$(libdir)/$(APPNAME).so install -m 0644 include/mts/* $(DESTDIR)$(includedir)/mts/ clean: $(RM) $(OBJS) $(APPNAME).a $(SONAME) $(DEPS)