annotate recpt1/Makefile @ 61:f1553492e8bb

ensure path of destination file exists. imported Jonathan Leffler's mkpath.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 09 Oct 2009 11:04:36 +0900
parents 9b36fdf7d5d0
children 57bb2c26198d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
0a6b831f4b89 added install rule.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 10
diff changeset
4 PREFIX = /usr/local
10
e3059e3cf5e7 revised Makefile.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
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
e3059e3cf5e7 revised Makefile.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
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
e3059e3cf5e7 revised Makefile.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
12 LDFLAGS =
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
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
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17 all: $(TARGET)
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
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
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21
10
e3059e3cf5e7 revised Makefile.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
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
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24
43
9b36fdf7d5d0 show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 21
diff changeset
25 $(DEPEND): version.h
10
e3059e3cf5e7 revised Makefile.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
26 $(CC) -MM $(OBJS:.o=.c) $(CPPFLAGS) > $@
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
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
0a6b831f4b89 added install rule.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 10
diff changeset
36 install: $(TARGET)
0a6b831f4b89 added install rule.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 10
diff changeset
37 install -m 755 $(TARGET) $(PREFIX)/bin
0a6b831f4b89 added install rule.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 10
diff changeset
38
43
9b36fdf7d5d0 show version option has been added
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 21
diff changeset
39 -include .deps