OLD | NEW |
---|---|
1 # Copyright 2011 The Native Client Authors. All rights reserved. | 1 # Copyright 2011 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can | 2 # Use of this source code is governed by a BSD-style license that can |
3 # be found in the LICENSE file. | 3 # be found in the LICENSE file. |
4 # | 4 # |
5 # A simple (Linux) example of building a client of a .so without having to have | 5 # A simple (Linux) example of building a client of a .so without having to have |
6 # that .so present. main depends upon libsimple.so. To create that dependency | 6 # that .so present. main depends upon libsimple.so. To create that dependency |
7 # when linking main, we create a dummy library, libempty.so, which has | 7 # when linking main, we create a dummy library, libempty.so, which has |
8 # soname=libsimple.so. | 8 # soname=libsimple.so. |
9 # | 9 # |
10 # This is intended to demonstrate how we might use ld on the platform until | 10 # This is intended to demonstrate how we might use ld on the platform until |
11 # llc produces .so files directly. | 11 # llc produces .so files directly. |
12 | 12 |
13 ARCH ?= -m64 | 13 ARCH ?= -m64 |
14 | 14 |
15 CFLAGS = -Wall -fPIC $(ARCH) | 15 CFLAGS = -Wall -fPIC $(ARCH) -I../../.. |
Mark Seaborn
2012/03/22 17:13:21
Why this change?
Nikolay
2012/03/23 11:35:20
Unneeded, thanks for spotting!
On 2012/03/22 17:1
| |
16 LIBFLAGS = -shared $(ARCH) -Wl,-soname,libsimple$(ARCH).so | 16 LIBFLAGS = -shared $(ARCH) -Wl,-soname,libsimple$(ARCH).so |
17 | 17 |
18 SIMPLE_OBJECTS = hello$(ARCH).o fortytwo$(ARCH).o | 18 SIMPLE_OBJECTS = hello$(ARCH).o fortytwo$(ARCH).o |
19 EMPTY_OBJECTS = empty$(ARCH).o | 19 EMPTY_OBJECTS = empty$(ARCH).o |
20 MAIN_OBJECTS = main$(ARCH).o | 20 MAIN_OBJECTS = main$(ARCH).o |
21 | 21 |
22 all: run | 22 all: run |
23 | 23 |
24 | 24 |
25 ###################################################################### | 25 ###################################################################### |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 | 57 |
58 ###################################################################### | 58 ###################################################################### |
59 # Run the requested architecture binary using libsimple$(ARCH).so | 59 # Run the requested architecture binary using libsimple$(ARCH).so |
60 run: main$(ARCH) libsimple$(ARCH).so | 60 run: main$(ARCH) libsimple$(ARCH).so |
61 LD_LIBRARY_PATH="." ./main$(ARCH) | 61 LD_LIBRARY_PATH="." ./main$(ARCH) |
62 | 62 |
63 | 63 |
64 ###################################################################### | 64 ###################################################################### |
65 clean: | 65 clean: |
66 rm -f main-* *.ll *.s *.o *.so *.pso *raw | 66 rm -f main-* *.ll *.s *.o *.so *.pso *raw |
OLD | NEW |