Add makefile for DIBS 78/183878/1
authorJunghoon Park <jh9216.park@samsung.com>
Thu, 12 Jul 2018 05:21:15 +0000 (14:21 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Thu, 12 Jul 2018 05:21:15 +0000 (14:21 +0900)
- 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>
Makefile.dibs [new file with mode: 0644]
build.sh
idlc/CMakeLists.txt
package/build.macos-64
package/build.windows

diff --git a/Makefile.dibs b/Makefile.dibs
new file mode 100644 (file)
index 0000000..cddb2ac
--- /dev/null
@@ -0,0 +1,55 @@
+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
index acfecac..42b93a4 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -16,7 +16,7 @@ usage() {
        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"
 }
@@ -31,14 +31,10 @@ cmd_build() {
        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() {
@@ -81,7 +77,7 @@ case "$cmd" in
        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 ;;
index 0cabeef..0507725 100644 (file)
@@ -14,19 +14,12 @@ IF(DEFINED BUILD_WIN)
   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}\"")
index 1fef8c4..b4080c4 100755 (executable)
@@ -12,7 +12,7 @@ build()
 {
        echo "=========================================BUILD============================================"
        cd ${SRCDIR}
-       bash -c "./build.sh build"
+       bash -c "./build.sh build_dibs"
 }
 
 # install
index edb7d1b..b7a1961 100644 (file)
@@ -12,7 +12,7 @@ build()
 {
         echo "=========================================BUILD============================================"
         cd ${SRCDIR}
-        bash -c "./build.sh build"
+        bash -c "./build.sh build_dibs"
 }
 
 # install