Mercurial > pt1.oyama
annotate recpt1/Makefile @ 62:c6a5c844c7fd
make some messages go stderr instead of stdout.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 09 Oct 2009 14:02:18 +0900 |
parents | f1553492e8bb |
children | 57bb2c26198d |
rev | line source |
---|---|
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
1 TARGET = recpt1 |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
2 RELEASE_VERSION = '1.0.0' |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
3 |
12 | 4 PREFIX = /usr/local |
10 | 5 CC = gcc |
21
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
6 CPPFLAGS = -I../driver -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DB25 |
10 | 7 CFLAGS = -O2 -g -pthread |
21
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
8 |
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
9 PCSC_LIBS = `pkg-config libpcsclite --libs` |
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
10 B25_LIBS = -larib25 |
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
11 LIBS = $(PCSC_LIBS) $(B25_LIBS) -lm -lpthread |
10 | 12 LDFLAGS = |
0 | 13 |
61
f1553492e8bb
ensure path of destination file exists. imported Jonathan Leffler's mkpath.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
43
diff
changeset
|
14 OBJS = recpt1.o decoder.o mkpath.o |
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
15 DEPEND = .deps |
0 | 16 |
17 all: $(TARGET) | |
18 | |
21
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
19 clean: |
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
20 rm -f $(OBJS) $(TARGET) $(DEPEND) version.h |
0 | 21 |
10 | 22 $(TARGET): $(OBJS) |
21
b63f5c100e5a
made recpt1 link against b25 shared object.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
12
diff
changeset
|
23 $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS) |
0 | 24 |
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
25 $(DEPEND): version.h |
10 | 26 $(CC) -MM $(OBJS:.o=.c) $(CPPFLAGS) > $@ |
0 | 27 |
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
28 version.h: |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
29 if test -d ../.hg ; then \ |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
30 revh=`hg parents --template 'const char *version = "r#rev#:#node|short# (#date|isodate#)";\n' 2>/dev/null`; \ |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
31 [ -z "$$revh" ] || echo "$$revh" > $@; \ |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
32 else \ |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
33 echo "const char *version = \"$(RELEASE_VERSION)\";" > $@; \ |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
34 fi |
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
35 |
12 | 36 install: $(TARGET) |
37 install -m 755 $(TARGET) $(PREFIX)/bin | |
38 | |
43
9b36fdf7d5d0
show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
21
diff
changeset
|
39 -include .deps |