diff options
author | Jesse Gilles <jgilles@multitech.com> | 2015-05-22 13:56:45 -0500 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2015-05-22 13:56:45 -0500 |
commit | 12eb2e9c901e9100e2fb938a64110263c24ea8e8 (patch) | |
tree | 001b5da0367b707e01232409530e814cea900161 /Makefile | |
download | lora-query-12eb2e9c901e9100e2fb938a64110263c24ea8e8.tar.gz lora-query-12eb2e9c901e9100e2fb938a64110263c24ea8e8.tar.bz2 lora-query-12eb2e9c901e9100e2fb938a64110263c24ea8e8.zip |
initial commit0.0.1
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..04de0ec --- /dev/null +++ b/Makefile @@ -0,0 +1,74 @@ + +includedir ?= /usr/include +libdir ?= /usr/lib + +CFLAGS += -Werror + +LIBS := -lmts -ljsoncpp -lpthread + +OBJS += \ +Version.o \ +main.o + +CPP_DEPS += \ +Version.d \ +main.d + + +all: postbuild + +prebuild: + @echo PRE-BUILD + @echo 'Removing previous version components started' + -$(RM) Version.o + -$(RM) Version.d + -$(RM) Version.cpp + @echo 'Removing previous version components complete' + @echo ' ' + +postbuild: mainbuild + @echo POST-BUILD + @echo ' ' + +mainbuild: prebuild + @echo MAIN-BUILD + @$(MAKE) --no-print-directory target + +target: $(OBJS) + @echo 'Building target: $@' + $(CXX) $(CFLAGS) $(LDFLAGS) -o lora-query $(OBJS) $(LIBS) + @echo 'Finished building target: $@' + @echo ' ' + +Version.o: Version.cpp + @echo 'Building file: $<' + $(CXX) $(CFLAGS) -Iinclude -Wall -Werror -c -std=c++0x -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + +Version.cpp: + @echo 'Creating file: Version.cpp' + /bin/echo -e "//Pre-Build Auto-Generated Source\n#include \"Version.h\"\n\nconst std::string Version::version(\"$(shell git describe)\");" > Version.cpp + @echo 'Finished creating: Version.cpp' + @echo ' ' + +main.o: main.cpp + @echo 'Building file: $<' + $(CXX) $(CFLAGS) -I=$(includedir)/jsoncpp -Wall -c -std=c++0x -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + +install: + install -d $(DESTDIR)/usr/bin + install -m 0755 lora-query $(DESTDIR)/usr/bin + +strip: + $(STRIP) lora-query + +clean: + -$(RM) $(OBJS) $(CPP_DEPS) lora-query + -@echo ' ' + +.PHONY: all clean dependents install strip target +.SECONDARY: + |