diff options
author | Jesse Gilles <jgilles@multitech.com> | 2015-04-20 16:49:52 -0500 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2015-04-20 16:49:52 -0500 |
commit | 17b117e73df71925d73ee026b4f54aa1867ce0a5 (patch) | |
tree | 382610c8e598a77a961c5ceb32b9b614ed00e757 /Makefile | |
download | libmts-17b117e73df71925d73ee026b4f54aa1867ce0a5.tar.gz libmts-17b117e73df71925d73ee026b4f54aa1867ce0a5.tar.bz2 libmts-17b117e73df71925d73ee026b4f54aa1867ce0a5.zip |
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d1e6a87 --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +include version + +includedir ?= /usr/include +libdir ?= /usr/lib + +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) + @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: + |