annotate arib25/src/Makefile @ 66:57bb2c26198d

fix a problem that compilation fails if hg is not installed.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 24 Oct 2009 16:49:53 +0900 (2009-10-24)
parents 7a03d5185067
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
1 PREFIX = /usr/local
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
2 MAJOR = 0
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
3 MINOR = 2
54
080414aa8f21 updated to arib25 0.2.4
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 53
diff changeset
4 REVISION = 4
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
5 VER = $(MAJOR).$(MINOR).$(REVISION)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
6
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
7 DEST_HEADER = $(PREFIX)/include/arib25
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
8
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
9 CC = gcc
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
10 PCSC_CFLAGS ?= `pkg-config libpcsclite --cflags`
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
11 CPPFLAGS = -Wall $(PCSC_CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
12 CFLAGS = -O2 -g -fPIC
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
13
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
14 PCSC_LIBS ?= `pkg-config libpcsclite --libs`
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
15 LIBS = $(PCSC_LIBS) -lm
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
16 LDFLAGS ?=
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17
23
f80731a89036 do not link td.o into shared object
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 22
diff changeset
18 OBJS = arib_std_b25.o b_cas_card.o multi2.o ts_section_parser.o
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
19 HEADERS = arib_std_b25.h b_cas_card.h portable.h
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
20 TARGET_APP = b25
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
21 TARGET_LIB = libarib25.so
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
22 TARGETS = $(TARGET_APP) $(TARGET_LIB)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
23 DEPEND = Makefile.dep
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
24 SONAME = $(TARGET_LIB).$(MAJOR)
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
25
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
26 all: $(TARGETS)
0
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
27
67e8eca28a80 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 clean:
23
f80731a89036 do not link td.o into shared object
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 22
diff changeset
29 rm -f $(OBJS) td.o $(TARGETS) $(DEPEND)
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
30
23
f80731a89036 do not link td.o into shared object
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 22
diff changeset
31 $(TARGET_APP): $(OBJS) td.o
f80731a89036 do not link td.o into shared object
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 22
diff changeset
32 $(CC) $(LDFLAGS) -o $(TARGET_APP) $(OBJS) td.o $(LIBS)
20
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
33
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
34 $(TARGET_LIB): $(OBJS)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
35 $(CC) $(LDFLAGS) -shared -o $(TARGET_LIB) $(OBJS) $(LIBS) -Wl,-soname,$(SONAME)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
36
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
37 $(DEPEND):
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
38 $(CC) -MM $(OBJS:.o=.c) $(CPPFLAGS) > $@
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
39
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
40 install: $(TARGET) install-headers
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
41 install -m755 b25 $(PREFIX)/bin
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
42 install -m755 $(TARGET_LIB) $(PREFIX)/lib/$(TARGET_LIB).$(VER)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
43 ln -sf $(PREFIX)/lib/$(TARGET_LIB).$(VER) $(PREFIX)/lib/$(TARGET_LIB).$(MAJOR)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
44 ln -sf $(PREFIX)/lib/$(TARGET_LIB).$(MAJOR) $(PREFIX)/lib/$(TARGET_LIB)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
45 ldconfig
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
46
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
47 install-headers:
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
48 mkdir -p $(DEST_HEADER)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
49 install -m644 $(HEADERS) $(DEST_HEADER)
669f7080a8dc reworked Makefile so that shared object would be built
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
50
58
7a03d5185067 tweaked Makefile
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 54
diff changeset
51 -include $(DEPEND)