comparison src/Makefile @ 173:03ab3ade9fe5

modify display version.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 29 Oct 2012 23:34:49 +0900
parents 061ef2cd98f0
children 27e5f99f8991
comparison
equal deleted inserted replaced
172:89e24a1c8a64 173:03ab3ade9fe5
98 98
99 $(PROG4): $(OBJS4) 99 $(PROG4): $(OBJS4)
100 $(CC) $(OBJS3) $(LDFLAGS) $(EXTRALIBS) -o $@ 100 $(CC) $(OBJS3) $(LDFLAGS) $(EXTRALIBS) -o $@
101 101
102 clean: 102 clean:
103 -$(RM) -f *.o $(PROG) $(PROG2) $(PROG3) $(PROG4) 103 -$(RM) -f *.o $(PROG) $(PROG2) $(PROG3) $(PROG4) version.h
104 -$(RM) -f .depend 104 -$(RM) -f .depend
105 105
106 distclean: 106 distclean:
107
108 version.h:
109 revh=`hg parents --template 'const char *version = "r{rev}:{node|short} ({date|shortdate})";\n' 2>/dev/null`; \
110 if [ -n "$$revh" ] ; then \
111 echo "$$revh" > $@; \
112 else \
113 echo "const char *version = \"$(RELEASE_VERSION)\";" > $@; \
114 fi
107 115
108 install: $(PROG) $(PROG2) $(PROG3) $(PROG4) 116 install: $(PROG) $(PROG2) $(PROG3) $(PROG4)
109 $(INSTALL) -d $(bindir) 117 $(INSTALL) -d $(bindir)
110 $(INSTALL) $(PROG) $(bindir) 118 $(INSTALL) $(PROG) $(bindir)
111 $(INSTALL) $(PROG2) $(bindir) 119 $(INSTALL) $(PROG2) $(bindir)
116 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG) 124 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG)
117 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG2) 125 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG2)
118 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG3) 126 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG3)
119 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG4) 127 $(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG4)
120 128
121 depend: 129 depend: version.h
122 $(CC) -I.. -MM $(CFLAGS) $(SRCS) 1>.depend 130 $(CC) -I.. -MM $(CFLAGS) $(SRCS) 1>.depend
123 131
124 .PHONY: clean distclean install depend 132 .PHONY: clean distclean install depend
125 133
126 dist-all: 134 dist-all: