Mercurial > pt1.oyama
annotate arib25/src/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 | 7a03d5185067 |
children |
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 | 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 | 8 |
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 | 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 | 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 | 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 | 27 |
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 | 51 -include $(DEPEND) |