summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2015-04-30 16:38:33 -0500
committerJesse Gilles <jgilles@multitech.com>2015-04-30 16:38:33 -0500
commit6d647eb03257c107bd818e1c39d137fb28d7c282 (patch)
treee834cc8f2bde757e08fad375477e13625d882e0a /Makefile
downloadradio-query-d25b46a410e25e864a72b2481a92571ebe0c132c.tar.gz
radio-query-d25b46a410e25e864a72b2481a92571ebe0c132c.tar.bz2
radio-query-d25b46a410e25e864a72b2481a92571ebe0c132c.zip
initial commit0.2
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile71
1 files changed, 71 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fc2b91a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,71 @@
+
+includedir ?= /usr/include
+libdir ?= /usr/lib
+
+LIBS := -lmts-io -lmts -ljsoncpp -lrt -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 radio-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 -Werror -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 radio-query $(DESTDIR)/usr/bin
+
+strip:
+ $(STRIP) radio-query
+
+clean:
+ -$(RM) $(OBJS) $(CPP_DEPS) radio-query
+ -@echo ' '
+
+.PHONY: all clean dependents install strip target
+.SECONDARY:
+