comparison recpt1/Makefile @ 43:9b36fdf7d5d0

show version option has been added
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 10 Jul 2009 22:36:06 +0900
parents b63f5c100e5a
children f1553492e8bb
comparison
equal deleted inserted replaced
42:a35e352f6c4a 43:9b36fdf7d5d0
1 TARGET = recpt1
2 RELEASE_VERSION = '1.0.0'
3
1 PREFIX = /usr/local 4 PREFIX = /usr/local
2 CC = gcc 5 CC = gcc
3 CPPFLAGS = -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DB25 6 CPPFLAGS = -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DB25
4 CFLAGS = -O2 -g -pthread 7 CFLAGS = -O2 -g -pthread
5 8
7 B25_LIBS = -larib25 10 B25_LIBS = -larib25
8 LIBS = $(PCSC_LIBS) $(B25_LIBS) -lm -lpthread 11 LIBS = $(PCSC_LIBS) $(B25_LIBS) -lm -lpthread
9 LDFLAGS = 12 LDFLAGS =
10 13
11 OBJS = recpt1.o decoder.o 14 OBJS = recpt1.o decoder.o
12 TARGET = recpt1 15 DEPEND = .deps
13 DEPEND = Makefile.dep
14 16
15 all: $(TARGET) 17 all: $(TARGET)
16 18
17 clean: 19 clean:
18 rm -f $(OBJS) $(TARGET) $(DEPEND) 20 rm -f $(OBJS) $(TARGET) $(DEPEND) version.h
19 21
20 $(TARGET): $(OBJS) 22 $(TARGET): $(OBJS)
21 $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS) 23 $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
22 24
23 $(DEPEND): 25 $(DEPEND): version.h
24 $(CC) -MM $(OBJS:.o=.c) $(CPPFLAGS) > $@ 26 $(CC) -MM $(OBJS:.o=.c) $(CPPFLAGS) > $@
27
28 version.h:
29 if test -d ../.hg ; then \
30 revh=`hg parents --template 'const char *version = "r#rev#:#node|short# (#date|isodate#)";\n' 2>/dev/null`; \
31 [ -z "$$revh" ] || echo "$$revh" > $@; \
32 else \
33 echo "const char *version = \"$(RELEASE_VERSION)\";" > $@; \
34 fi
25 35
26 install: $(TARGET) 36 install: $(TARGET)
27 install -m 755 $(TARGET) $(PREFIX)/bin 37 install -m 755 $(TARGET) $(PREFIX)/bin
28 38
29 -include Makefile.dep 39 -include .deps