anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | # |
| 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 | |
| 17 | include ../../Makefile.common |
| 18 | |
| 19 | CC := g++ |
| 20 | CFLAGS += -std=c++11 |
| 21 | |
| 22 | ifeq ($(DEBUG),true) |
| 23 | CFLAGS += -g |
| 24 | endif |
| 25 | |
| 26 | ifeq ($(DEBUG),false) |
| 27 | CFLAGS += -O3 |
| 28 | endif |
| 29 | |
| 30 | SM_LIBNAME = $(LIBDIR)/libstatemachinefwk.so |
| 31 | |
| 32 | SRCS := \ |
| 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 | |
| 42 | SRCDIR := . |
| 43 | OBJECTS := $(patsubst $(SRCDIR)/%,$(OBJDIR)/stateMachineFwk/%,$(SRCS:.cpp=.o)) |
| 44 | |
| 45 | buildSmLIB: $(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 | |
| 54 | all: buildSmLIB |
| 55 | |
| 56 | install:all |
| 57 | -@echo "Installing" |
| 58 | -@mkdir -p $(TARGET_DIR)/lib |
| 59 | -@cp $(SM_LIBNAME) $(TARGET_DIR)/lib |
| 60 | |
| 61 | clean: |
| 62 | @echo " Cleaning..."; |
| 63 | -@rm -rf $(OBJDIR)/stateMachineFwk $(SM_LIBNAME) |
| 64 | |