include version includedir ?= /usr/include libdir ?= /usr/lib LIBS = -lpthread OBJS += \ MTS_Buffer.o \ MTS_Condition.o \ MTS_Lock.o \ MTS_Logger.o \ MTS_Object.o \ MTS_SignalThread.o \ MTS_System.o \ MTS_Text.o \ MTS_Thread.o \ MTS_Timer.o \ MTS_TimerThread.o CPP_DEPPS += \ MTS_Buffer.d \ MTS_Condition.d \ MTS_Lock.d \ MTS_Logger.d \ MTS_Object.d \ MTS_SignalThread.d \ MTS_System.d \ MTS_Text.d \ MTS_Thread.d \ MTS_Timer.d \ MTS_TimerThread.d all: libmts.a libmts.so.0 libmts.a: $(OBJS) @echo 'Building target: $@' $(AR) -r libmts.a $(OBJS) @echo 'Finished building target: $@' @echo ' ' libmts.so.0: $(OBJS) @echo 'Building target: $@' $(CXX) -shared -Wl,-soname,$@ -o libmts.so.$(VERSION) $(OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' %.o: src/%.cpp @echo 'Building file: $<' $(CXX) $(CFLAGS) -Iinclude -Wall -Werror -c -fPIC -fmessage-length=0 -std=c++0x -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' install: mkdir -p $(DESTDIR)$(libdir) mkdir -p $(DESTDIR)$(includedir)/mts install -m 0644 libmts.a libmts.so.$(VERSION) $(DESTDIR)$(libdir)/ ln -sf libmts.so.$(VERSION) $(DESTDIR)$(libdir)/libmts.so.0 ln -sf libmts.so.0 $(DESTDIR)$(libdir)/libmts.so install -m 0644 include/mts/* $(DESTDIR)$(includedir)/mts/ clean: -$(RM) $(OBJS) $(CPP_DEPPS) libmts.a libmts.so* -@echo ' ' .PHONY: all clean dependents install .SECONDARY: