- Because DIBS for windows and macOS does not support cmake, the makefile was added
Change-Id: Idc7274012a8363b14184d67fb3c1b2354c2847ce
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
--- /dev/null
+CXX := g++
+SRC_FILES := \
+ idlc/tidlc_y.cpp \
+ idlc/tidlc_l.cpp \
+ idlc/cs_gen/cs_lib_gen.cc \
+ idlc/cs_gen/cs_gen_base.cc \
+ idlc/cs_gen/cs_proxy_gen.cc \
+ idlc/cs_gen/cs_stub_gen.cc \
+ idlc/c_gen/c_proxy_body_gen.cc \
+ idlc/c_gen/c_stub_body_gen.cc \
+ idlc/c_gen/c_body_gen_base.cc \
+ idlc/c_gen/c_proxy_header_gen.cc \
+ idlc/c_gen/c_gen_base.cc \
+ idlc/c_gen/c_header_gen_base.cc \
+ idlc/c_gen/c_stub_header_gen.cc \
+ idlc/cpp_gen/cpp_gen_base.cc \
+ idlc/cpp_gen/cpp_proxy_body_gen.cc \
+ idlc/cpp_gen/cpp_proxy_header_gen.cc \
+ idlc/cpp_gen/cpp_stub_body_gen.cc \
+ idlc/cpp_gen/cpp_stub_header_gen.cc \
+ idlc/document.cc \
+ idlc/main.cc \
+ idlc/structure.cc \
+ idlc/type.cc \
+ idlc/declaration.cc \
+ idlc/attribute.cc \
+ idlc/parameter.cc \
+ idlc/generator.cc \
+ idlc/interface.cc \
+ idlc/element.cc \
+ idlc/block.cc \
+ idlc/parser.cc
+
+INCS := \
+ -I./
+
+CXXFLAGS := \
+ -O2 -Wall -Wno-unused-function -Wno-sign-compare -std=c++11 -static-libstdc++ -Werror -DFULLVER=\"$(FULLVER)\"
+
+OBJDIR := build
+BINDIR := build/idlc
+
+all : tidlc
+
+tidlc : build_l build_y $(SRC_FILES)
+ rm -rf $(OBJDIR)
+ mkdir $(OBJDIR)
+ mkdir $(BINDIR)
+ $(CXX) $(CXXFLAGS) $(INCS) -o $(BINDIR)/$@ $(SRC_FILES)
+
+build_l :
+ /usr/bin/flex -o ./idlc/tidlc_l.cpp ./idlc/tidlc.ll
+
+build_y :
+ /usr/bin/bison -d -o ./idlc/tidlc_y.cpp ./idlc/tidlc.yy
echo " build Build the package"
echo " build_win Build the package for 64bit Windows"
echo " build_win32 Build the package for 32bit Windows"
- echo " build_mac Build the package for 64bit macos"
+ echo " build_dibs Build the package using DIBS"
echo " clean Clean all artifacts"
echo " clean_build Clean & Build the package"
}
make
}
-cmd_build_mac() {
+cmd_build_dibs() {
echo "[TIDL] Build the package"
- mkdir -p $SCRIPT_DIR/$BUILD_DIR
- cd $SCRIPT_DIR/$BUILD_DIR
- VER=`cat ../packaging/tidl.spec | grep 'Version' | sed 's/Version://' | tr -d ' \r'`
- cmake .. -DFULLVER=$VER -DMINIMUM_BUILD="yes" -DBUILD_MACOS="yes"
- make clean
- make
+ VER=`cat ./packaging/tidl.spec | grep 'Version' | sed 's/Version://' | tr -d ' \r'`
+ FULLVER=$VER make -f Makefile.dibs
}
cmd_build_win() {
build|--build|-b) cmd_build $@ ;;
build_win|--build_win|-bw) cmd_build_win $@ ;;
build_win32|--build_win32|-bw32) cmd_build_win32 $@ ;;
- build_mac|--build_mac|-bm) cmd_build_mac $@ ;;
+ build_dibs|--build_dib|-dibs) cmd_build_dibs $@ ;;
clean|--clean|-c) cmd_clean $@ ;;
clean_build |--clean_build |-cb) cmd_clean_build $@ ;;
*) usage ;;
SET(EXE_STATIC "-static")
ENDIF(DEFINED BUILD_WIN)
-IF(DEFINED BUILD_MACOS)
- SET(CMAKE_CXX_COMPILER "x86_64-apple-darwin15-clang++")
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -stdlib=libc++")
-ELSE(DEFINED BUILD_MACOS)
- SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc")
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
-ENDIF(DEFINED BUILD_MACOS)
-
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wno-unused-function -Wno-sign-compare")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++")
+SET(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static-libgcc")
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
ADD_DEFINITIONS("-DFULLVER=\"${FULLVER}\"")
{
echo "=========================================BUILD============================================"
cd ${SRCDIR}
- bash -c "./build.sh build"
+ bash -c "./build.sh build_dibs"
}
# install
{
echo "=========================================BUILD============================================"
cd ${SRCDIR}
- bash -c "./build.sh build"
+ bash -c "./build.sh build_dibs"
}
# install