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 # This directory has two exported targets:
32 # libsrpc.a is the NativeClient library for building RPC services
33 # A part of this is a main function with a message processing loop
35 # nonnacl_srpc.a is the library used to build non-nacl SRPC tools
37 # This Makefile only makes the (untrusted) NativeClient library.
43 # The libraries are installed relative to NCCDIR.
45 # Set up paths for tools, etc.
46 NCCDIR ?= /usr/local/nacl-sdk/nacl
47 NCCC=$(NCCDIR)/../bin/nacl-gcc
48 NCAR=$(NCCDIR)/../bin/nacl-ar
51 NC_CFLAGS += -O3 -Werror -Wall -Wswitch-enum -g -fno-builtin \
52 -fno-stack-protector -fnacl-library-mode \
56 $(NCCC) -c $(NC_CFLAGS) -o $@ $<
59 # libsrpc.a build rules
60 LIBSRPC_SOURCES= accept_loop.c \
65 rpc_interface_desc.c \
72 LIBSRPC_OBJS=$(LIBSRPC_SOURCES:.c=.no)
74 # The object files that make up libsrpc.a.
75 $(LIBSRPC_OBJS): ../../include/portability.h nacl_srpc.h
77 libsrpc.a: $(LIBSRPC_OBJS)
78 $(NCAR) crs libsrpc.a $(LIBSRPC_OBJS)
80 ALL_SOURCES=$(LIBSRPC_SOURCES)
82 # The headers that get installed in the SDK directory.
83 LIBNACL_HEADERS=nacl_srpc.h
85 # Installing the library and header files in the SDK directory.
86 install: libsrpc.a $(LIBNACL_HEADERS)
87 cp libsrpc.a $(NCCDIR)/lib
88 -mkdir -p $(NCCDIR)/include/nacl
89 cp -f $(LIBNACL_HEADERS) $(NCCDIR)/include/nacl
91 makedep.nacl: $(ALL_SOURCES)
92 $(NCCC) -M $(NC_CFLAGS) $(LIBSRPC_SOURCES) > makedep.nacl
95 rm -f libsrpc.a *.no \
99 .PHONY: all clean export