2 # Copyright (c) 2013, McAfee, Inc.
6 # Redistribution and use in source and binary forms, with or without modification,
7 # are permitted provided that the following conditions are met:
9 # Redistributions of source code must retain the above copyright notice, this list
10 # of conditions and the following disclaimer.
12 # Redistributions in binary form must reproduce the above copyright notice, this
13 # list of conditions and the following disclaimer in the documentation and/or other
14 # materials provided with the distribution.
16 # Neither the name of McAfee, Inc. nor the names of its contributors may be used
17 # to endorse or promote products derived from this software without specific prior
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28 # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 # OF THE POSSIBILITY OF SUCH DAMAGE.
33 TARGET = $(OUTDIR)/libsecfw.so
35 INCLUDE = -I. $(TCS_INC) -I../plugin
36 LD_FLAGS := $(LD_FLAGS) -ldl -lpthread $(shell pkg-config --libs libtzplatform-config)
59 ifeq ($(TCS_CFG), release)
60 CFLAGS := -O3 -fPIC $(INCLUDE) -DUNIX $(CFLAGS)
62 CFLAGS := -g -fPIC $(INCLUDE) -DUNIX -DDEBUG $(CFLAGS)
65 CFLAGS := $(CFLAGS) $(PKCL_CFLAGS) $(TCS_CFLAGS)
67 # Define a list of pkg-config packages we want to use
70 PKG_CFLAGS = $(shell pkg-config --cflags $(pkg_packages))
71 PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages))
73 # Combine user supplied, additional, and pkg-config flags
74 ifeq ($(TCS_CFG), release)
78 PKGLD_FLAGS += $(PKG_LDFLAGS) -L./lib
79 PKGCFLAGS += -I$(SRCDIR) $(PKCL_CFLAGS) $(PKG_CFLAGS)
82 SOURCES = $(SRCDIR)/TCSImpl.c $(SRCDIR)/TWPImpl.c
84 OBJECTS = $(OUTDIR)/TCSImpl.o $(OUTDIR)/TWPImpl.o
86 $(OUTDIR)/%.o: $(SRCDIR)/%.c
87 $(CC) $(CFLAGS) $(PKGCFLAGS) -I. -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c
89 all: $(OUTDIR) $(TARGET)
92 $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKGLD_FLAGS)
103 @rm -f *.bb *.bbg *.da *.gcov