1 # Copyright 2008, Google Inc.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 # The main target of this directory is the library libnacl.a
32 # This provides the low-level interface layer for newlib.
36 include ..
/..
/include/linux
/makeconfig
38 # The libraries are installed relative to NCCDIR.
40 # Set up paths for tools, etc.
41 NCCDIR ?
= /usr
/local
/nacl-sdk
/nacl
42 NCCC
=$(NCCDIR
)/..
/bin
/nacl-gcc
43 NCAR
=$(NCCDIR
)/..
/bin
/nacl-ar
45 NC_CFLAGS
+= -O3
-Werror
-Wall
-Wswitch-enum
-g
-fno-builtin \
46 -fno-stack-protector
$(OSFLAGS
) \
50 $(NCCC
) -c
$(NC_CFLAGS
) -o
$@
$<
53 $(NCCC
) -c
$(NC_CFLAGS
) -o
$@
$<
56 # C files defining runtime functions.
57 LIBNACL_C_FILES
=close.c \
68 imc_mem_obj_create.c \
95 LIBNACL_C_OBJS
=$(LIBNACL_C_FILES
:.c
=.o
)
97 # Asm files that wrap the entry points into the service runtime.
98 LIBNACL_ASM_FILES
=nacl_clock.S \
104 nacl_gettimeofday.S \
107 nacl_imc_makeboundsock.S \
108 nacl_imc_mem_obj_create.S \
111 nacl_imc_socketpair.S \
127 LIBNACL_ASM_OBJS
=$(LIBNACL_ASM_FILES
:.S
=.o
)
129 ALL_SOURCES
=$(LIBNACL_C_FILES
) $(LIBNACL_ASM_FILES
)
131 INTERNAL_HEADERS
=nacl.h
132 SERVICE_RUNTIME_HEADERS
=..
/..
/service_runtime
/nacl_config.h \
133 ..
/..
/service_runtime
/nacl_syscalls.h
135 # The files that make up the library.
136 $(APP_LIBC_OBJS
): $(INTERNAL_HEADERS
) $(SERVICE_RUNTIME_HEADERS
)
138 libnacl.a
: $(LIBNACL_C_OBJS
) $(LIBNACL_ASM_OBJS
)
139 $(NCAR
) crs libnacl.a
$(LIBNACL_C_OBJS
) $(LIBNACL_ASM_OBJS
)
141 # The headers for building IMC clients under NaCl.
142 LIBNACL_IMC_HEADERS
=..
/..
/intermodule_comm
/nacl_imc.h \
143 ..
/..
/intermodule_comm
/nacl_imc_c.h
144 # The headers for building NPAPI plugins to run under NaCl.
145 LIBNACL_NPAPI_HEADER_DIR
=..
/..
/..
/third_party
/npapi
/files
/include
146 LIBNACL_NPAPI_HEADERS
=..
/npapi_runtime
/nacl_npapi.h \
147 $(LIBNACL_NPAPI_HEADER_DIR
)/npapi.h \
148 $(LIBNACL_NPAPI_HEADER_DIR
)/npruntime.h \
149 $(LIBNACL_NPAPI_HEADER_DIR
)/nptypes.h \
150 $(LIBNACL_NPAPI_HEADER_DIR
)/npupp.h \
151 # The headers that get installed in the SDK directory.
152 LIBNACL_HEADERS
=tls.h\
153 $(LIBNACL_IMC_HEADERS
) \
154 $(LIBNACL_NPAPI_HEADERS
)
156 # Installing the library and header files in the SDK directory.
157 install: libnacl.a
$(LIBNACL_HEADERS
)
158 cp libnacl.a
$(NCCDIR
)/lib
159 mkdir
-p
$(NCCDIR
)/include/nacl
160 cp
-f
$(LIBNACL_HEADERS
) $(NCCDIR
)/include/nacl
162 makedep
: $(ALL_SOURCES
)
163 $(NCCC
) -M
$(NC_CFLAGS
) $(ALL_SOURCES
) > makedep
166 rm -f libnacl.a
*.o \