blob: a7a88bb67e1c894282207eb71f9d8a634fa67d24 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301#
2# Copyright (c) 2019, Infosys Ltd.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17include ../../Makefile.common
18
19CC := g++
20CFLAGS += -std=c++11
21
22ifeq ($(DEBUG),true)
23 CFLAGS += -g
24endif
25
26ifeq ($(DEBUG),false)
27 CFLAGS += -O3
28endif
29
30SM_LIBNAME = $(LIBDIR)/libstatemachinefwk.so
31
32SRCS := \
33 ./actionTable.cpp \
34 ./controlBlock.cpp \
35 ./event.cpp \
36 ./permDataBlock.cpp \
37 ./procedureQueue.cpp \
38 ./state.cpp \
39 ./stateMachineEngine.cpp \
40 ./tempDataBlock.cpp
41
42SRCDIR := .
43OBJECTS := $(patsubst $(SRCDIR)/%,$(OBJDIR)/stateMachineFwk/%,$(SRCS:.cpp=.o))
44
45buildSmLIB: $(OBJECTS)
46 @echo "Linking"
47 @mkdir -p $(LIBDIR)
48 $(CC) $(CFLAGS) $(OBJECTS) -shared -o $(SM_LIBNAME)
49
50$(OBJECTS) : $(OBJDIR)/stateMachineFwk/%.o : $(SRCDIR)/%.cpp
51 @mkdir -p $(OBJDIR)/stateMachineFwk
52 $(CC) $(CFLAGS) $(INC_DIRS) -fPIC -c -o $@ $<
53
54all: buildSmLIB
55
56install:all
57 -@echo "Installing"
58 -@mkdir -p $(TARGET_DIR)/lib
59 -@cp $(SM_LIBNAME) $(TARGET_DIR)/lib
60
61clean:
62 @echo " Cleaning...";
63 -@rm -rf $(OBJDIR)/stateMachineFwk $(SM_LIBNAME)
64