Error in cyttsp4 (linux kernel) Makefile - c++

The below is the Makefile for cyttsp4 inside the Linux kernel that I'm compiling for Android, using the kyasu msm8974 project (https://github.com/kyasu/android_kernel_samsung_msm8974).
### CYTTSP
#obj-m += cyttsp4.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_core.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_i2c.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_platform.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_devtree.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_mt_common.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_mtb.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_btn.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_debug.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_device_access.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_loader.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_samsung_sysfs.o
CY_CFLAG_ADD =\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICETREE_SUPPORT\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BUTTON\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_LOADER\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_FW_UPGRADE\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BINARY_FW_UPGRADE
CY_CFLAG_REMOVE =\
-DCYTTSP4_PDATA_IN_PLATFORM_C\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PROXIMITY\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_TTCONFIG_UPGRADE\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS_API\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEBUG\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_MANUAL_TTCONFIG_UPGRADE
CFLAGS_cyttsp4_core.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_i2c.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_spi.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mta.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mtb.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_a.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_b.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_common.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_btn.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_proximity.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_samsung_sysfs.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_device_access.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_test_device_access_api.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_loader.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_debug.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_devtree.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_platform.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_core.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_i2c.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_spi.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_mta.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_mtb.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_mt_a.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_mt_b.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_mt_common.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_btn.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_proximity.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_samsung_sysfs.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_device_access.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_test_device_access_api.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_loader.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_debug.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_devtree.o -= $(CY_CFLAG_REMOVE)
CFLAGS_cyttsp4_platform.o -= $(CY_CFLAG_REMOVE)
The error I'm getting is:
/home/USER/Projects/OS/android_kernel_samsung_msm8974/drivers/gpu/gpu_sysfs/Kbuild:29: **** Make sure target file is defined. Check the TARGET and GPU configs in Makefile and Kernel Config. Module won't work without target file. ****
/home/USER/Projects/OS/android_kernel_samsung_msm8974/drivers/input/touchscreen/cyttsp4/Makefile:50: *** missing separator. Stop.
scripts/Makefile.clean:94: recipe for target 'drivers/input/touchscreen/cyttsp4' failed
make[3]: *** [drivers/input/touchscreen/cyttsp4] Error 2
scripts/Makefile.clean:94: recipe for target 'drivers/input/touchscreen' failed
make[2]: *** [drivers/input/touchscreen] Error 2
scripts/Makefile.clean:94: recipe for target 'drivers/input' failed
make[1]: *** [drivers/input] Error 2
Makefile:1201: recipe for target '_clean_drivers' failed
make: *** [_clean_drivers] Error 2

This is (partially) written using my S4 i9506 as a keyboard, if you want Nethunter on your S4 comment your interest and ill get started on a guide to port it yourself. I'll make one soon anyway but if people are interested I'll put more effort into making a guide to porting Nethunter faster.
Basically, as mentioned by #Tsyvarev, there's no -= command in Makefiles. Basically, whoever made the Makefile for Cyttsp4 (at least in the kernel sources I had) didn't do a very good job and after some research they probably thought just like me that the separator missing error was due to a missing tab somewhere which everyone suggests when you search for this issue. A quick search with #Tsyvarev's info about -= not existing I found the proper way to do what they want. Here's the complete Makefile with the proper alteration. You use $(filter-out, VARS_TO_REMOVE, RESULT) to remove flags.
The error is so stupid I don't see how it was made in the first place, considering it was found inside the source code of a kernel, and the people that make kernels are generally not this unskilled, or else they wouldn't be making kernels.
Wait a minute... I'm making errors and I'm... Oh...
Anyway, here's the code!
### CYTTSP
#obj-m += cyttsp4.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_core.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_i2c.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_platform.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_devtree.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_mt_common.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_mtb.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_btn.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_debug.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_device_access.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_loader.o
obj-$(CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4) += cyttsp4_samsung_sysfs.o
CY_CFLAG_ADD =\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICETREE_SUPPORT\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BUTTON\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_LOADER\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_FW_UPGRADE\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BINARY_FW_UPGRADE
CY_CFLAG_REMOVE =\
-DCYTTSP4_PDATA_IN_PLATFORM_C\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PROXIMITY\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_TTCONFIG_UPGRADE\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS_API\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEBUG\
-DCONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_MANUAL_TTCONFIG_UPGRADE
CFLAGS_cyttsp4_core.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_i2c.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_spi.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mta.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mtb.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_a.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_b.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_mt_common.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_btn.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_proximity.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_samsung_sysfs.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_device_access.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_test_device_access_api.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_loader.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_debug.o += $(CY_CFLAG_ADD)
CFLAGS_cyttsp4_devtree.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_platform.o += $(CY_CFLAG_ADD) -DDEBUG
CFLAGS_cyttsp4_core.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_core.o))
CFLAGS_cyttsp4_i2c.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_i2c.o))
CFLAGS_cyttsp4_spi.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_spi.o))
CFLAGS_cyttsp4_mta.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_mta.o))
CFLAGS_cyttsp4_mtb.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_mtb.o))
CFLAGS_cyttsp4_mt_a.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_mt_a.o))
CFLAGS_cyttsp4_mt_b.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_mt_b.o))
CFLAGS_cyttsp4_mt_common.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_mt_common.o))
CFLAGS_cyttsp4_btn.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_btn.o))
CFLAGS_cyttsp4_proximity.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_proximity.o))
CFLAGS_cyttsp4_samsung_sysfs.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_samsung_sysfs.o))
CFLAGS_cyttsp4_device_access.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_device_access.o))
CFLAGS_cyttsp4_test_device_access_api.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_test_device_access_api.o))
CFLAGS_cyttsp4_loader.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_loader.o))
CFLAGS_cyttsp4_debug.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_debug.o))
CFLAGS_cyttsp4_devtree.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_devtree.o))
CFLAGS_cyttsp4_platform.o := $(filter-out $(CY_CFLAG_REMOVE),$(CFLAGS_cyttsp4_platform.o))

Related

Undefined reference error with mingw compiler and mvsc compiled library

An undefined reference error on minGW 8.1 in Qt 5.15.2 with any build-up in VS2015. With mvsc 2015 and 2017, the compiler works fine, but with minGW, it gives an error on undefined reference. What needs to be done to make it work on minGW too? Has anyone come across this?
.pro file:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
PRODDIR = "../.."
SOURCES += "$${PRODDIR}/include/qsecureblackbox.cpp" main.cpp archivewriter.cpp certificate.cpp filetablemodel.cpp newarchive.cpp openarchive.cpp progress.cpp
HEADERS += "$${PRODDIR}/include/qarchivereader.h" "$${PRODDIR}/include/qarchivewriter.h" "$${PRODDIR}/include/qasicsigner.h" "$${PRODDIR}/include/qasicverifier.h" "$${PRODDIR}/include/qauthenticator.h" "$${PRODDIR}/include/qauthenticodesigner.h" "$${PRODDIR}/include/qauthenticodeverifier.h" "$${PRODDIR}/include/qcadessigner.h" "$${PRODDIR}/include/qcadesverifier.h" "$${PRODDIR}/include/qcertificatemanager.h" "$${PRODDIR}/include/qcertificatestorage.h" "$${PRODDIR}/include/qcertificatevalidator.h" "$${PRODDIR}/include/qcrlmanager.h" "$${PRODDIR}/include/qcryptokeymanager.h" "$${PRODDIR}/include/qcryptokeystorage.h" "$${PRODDIR}/include/qdcauth.h" "$${PRODDIR}/include/qdcauthwebserver.h" "$${PRODDIR}/include/qdtlsclient.h" "$${PRODDIR}/include/qdtlsserver.h" "$${PRODDIR}/include/qftpclient.h" "$${PRODDIR}/include/qftpserver.h" "$${PRODDIR}/include/qhashfunction.h" "$${PRODDIR}/include/qhttpclient.h" "$${PRODDIR}/include/qhttpserver.h" "$${PRODDIR}/include/qimapclient.h" "$${PRODDIR}/include/qkmipclient.h" "$${PRODDIR}/include/qkmipserver.h" "$${PRODDIR}/include/qmailreader.h" "$${PRODDIR}/include/qmailwriter.h" "$${PRODDIR}/include/qmessagecompressor.h" "$${PRODDIR}/include/qmessagedecompressor.h" "$${PRODDIR}/include/qmessagedecryptor.h" "$${PRODDIR}/include/qmessageencryptor.h" "$${PRODDIR}/include/qmessagesigner.h" "$${PRODDIR}/include/qmessagetimestamper.h" "$${PRODDIR}/include/qmessagetimestampverifier.h" "$${PRODDIR}/include/qmessageverifier.h" "$${PRODDIR}/include/qoauthclient.h" "$${PRODDIR}/include/qocspmanager.h" "$${PRODDIR}/include/qocspserver.h" "$${PRODDIR}/include/qofficedecryptor.h" "$${PRODDIR}/include/qofficeencryptor.h" "$${PRODDIR}/include/qofficequicksigner.h" "$${PRODDIR}/include/qofficesigner.h" "$${PRODDIR}/include/qofficeverifier.h" "$${PRODDIR}/include/qotpclient.h" "$${PRODDIR}/include/qotpserver.h" "$${PRODDIR}/include/qpasswordvault.h" "$${PRODDIR}/include/qpdfdecryptor.h" "$${PRODDIR}/include/qpdfencryptor.h" "$${PRODDIR}/include/qpdfsigner.h" "$${PRODDIR}/include/qpdfverifier.h" "$${PRODDIR}/include/qpgpkeymanager.h" "$${PRODDIR}/include/qpgpkeyring.h" "$${PRODDIR}/include/qpgpreader.h" "$${PRODDIR}/include/qpgpwriter.h" "$${PRODDIR}/include/qpop3client.h" "$${PRODDIR}/include/qpublickeycrypto.h" "$${PRODDIR}/include/qrestclient.h" "$${PRODDIR}/include/qrestserver.h" "$${PRODDIR}/include/qrnd.h" "$${PRODDIR}/include/qsamlidpserver.h" "$${PRODDIR}/include/qsamlreader.h" "$${PRODDIR}/include/qsamlspserver.h" "$${PRODDIR}/include/qsamlwriter.h" "$${PRODDIR}/include/qsftpclient.h" "$${PRODDIR}/include/qsftpserver.h" "$${PRODDIR}/include/qsmtpclient.h" "$${PRODDIR}/include/qsoapclient.h" "$${PRODDIR}/include/qsoapquicksigner.h" "$${PRODDIR}/include/qsoapsigner.h" "$${PRODDIR}/include/qsoapverifier.h" "$${PRODDIR}/include/qsshclient.h" "$${PRODDIR}/include/qsshkeymanager.h" "$${PRODDIR}/include/qsymmetriccrypto.h" "$${PRODDIR}/include/qtlsclient.h" "$${PRODDIR}/include/qtlsserver.h" "$${PRODDIR}/include/qtspserver.h" "$${PRODDIR}/include/qusermanager.h" "$${PRODDIR}/include/qwebdavclient.h" "$${PRODDIR}/include/qwebdavserver.h" "$${PRODDIR}/include/qwebsocketclient.h" "$${PRODDIR}/include/qwebsocketserver.h" "$${PRODDIR}/include/qxadessigner.h" "$${PRODDIR}/include/qxadesverifier.h" "$${PRODDIR}/include/qxmldecryptor.h" "$${PRODDIR}/include/qxmlencryptor.h" "$${PRODDIR}/include/qxmlsigner.h" "$${PRODDIR}/include/qxmlverifier.h" archivewriter.h certificate.h filetablemodel.h newarchive.h openarchive.h progress.h
FORMS += archivewriter.ui certificate.ui newarchive.ui openarchive.ui progress.ui
INCLUDEPATH += "$${PRODDIR}/include"
DEPENDPATH += "$${PRODDIR}/include"
greaterThan(QT_MAJOR_VERSION, 4) { TARGET_ARCH = $${QT_ARCH} } else { TARGET_ARCH = $${QMAKE_HOST.arch} }
contains(TARGET_ARCH, x86_64) { LIBDIR = lib64 } else { LIBDIR = lib }
CONFIG(debug, debug|release) { VARIANT = debug } else { VARIANT = release }
PLATDIR = windows
LIBS += -ladvapi32
LIBNAME = qtsecureblackbox20
# Ensures the product's DLL is copied to the output directory.
LIBPATH = "$${PRODDIR}/$${LIBDIR}/$${PLATDIR}/$${LIBNAME}.dll"
copydll.commands = $(COPY_FILE) \"$$replace(LIBPATH, /, \\)\" \"$$replace(OUT_PWD, /, \\)\\$${VARIANT}\"
first.depends = $(first) copydll
export(first.depends)
export(copydll.commands)
QMAKE_EXTRA_TARGETS += first copydll
LIBS += -L"$${PRODDIR}/$${LIBDIR}/$${PLATDIR}" -l$${LIBNAME}

gcc makefile compilation & syntax. How c compiler is called and multiple included paths

I am pretty new in Linux/C++ so I need your help to understad the makefile below.
So my question are
1) how c compiler is called ? I can not find any calls and
2) what is the correct syntax to declared multiple included paths in the INC_DIR directive ?
This make file is used under cygwin64 terminal and Windows 10.
# the SOURCE definiton lets move your makefile to another position
CONFIG = LIBRARY
# set pathes to the correct directories
SRC_DIR = ../../../../source/Lib/TLibCommon
INC_DIR = ../../../../source/Lib
LIB_DIR = ../../../../lib
BIN_DIR = ../../../../bin
SRC_DIR1 = ../../../../source/Lib/libmd5
SRC_DIR2 =
SRC_DIR3 =
SRC_DIR4 =
USER_INC_DIRS = -I$(SRC_DIR)
USER_LIB_DIRS =
ifeq ($(HIGHBITDEPTH), 1)
HBD=HighBitDepth
else
HBD=
endif
# intermediate directory for object files
OBJ_DIR = ./objects$(HBD)
# the library name
PRJ_NAME = TLibCommon$(HBD)
# version information
MAJOR_VER = 0
MINOR_VER = 1
VER = $(MAJOR_VER).$(MINOR_VER)
# defines to set
DEFS = -DMSYS_LINUX
# set objects
OBJS = \
$(OBJ_DIR)/Debug.o \
$(OBJ_DIR)/TComPicYuv.o \
$(OBJ_DIR)/TComYuv.o \
$(OBJ_DIR)/ContextModel.o \
$(OBJ_DIR)/ContextModel3DBuffer.o \
$(OBJ_DIR)/SEI.o \
$(OBJ_DIR)/TComCABACTables.o \
$(OBJ_DIR)/TComSampleAdaptiveOffset.o \
$(OBJ_DIR)/TComBitStream.o \
$(OBJ_DIR)/TComChromaFormat.o \
$(OBJ_DIR)/TComDataCU.o \
$(OBJ_DIR)/TComLoopFilter.o \
$(OBJ_DIR)/TComMotionInfo.o \
$(OBJ_DIR)/TComPattern.o \
$(OBJ_DIR)/TComPic.o \
$(OBJ_DIR)/TComPicSym.o \
$(OBJ_DIR)/TComPicYuvMD5.o \
$(OBJ_DIR)/TComPrediction.o \
$(OBJ_DIR)/TComRdCost.o \
$(OBJ_DIR)/TComRom.o \
$(OBJ_DIR)/TComSlice.o \
$(OBJ_DIR)/TComTrQuant.o \
$(OBJ_DIR)/TComTU.o \
$(OBJ_DIR)/TComInterpolationFilter.o \
$(OBJ_DIR)/libmd5.o \
$(OBJ_DIR)/TComWeightPrediction.o \
$(OBJ_DIR)/TComRdCostWeightPrediction.o \
LIBS = -lpthread
DEBUG_LIBS =
RELEASE_LIBS =
STAT_LIBS =
DYN_LIBS = -ldl
# the libraries to link with
STAT_DEBUG_LIBS =
STAT_RELEASE_LIBS =
DYN_DEBUG_LIBS =
DYN_RELEASE_LIBS =
# name of the base makefile
MAKE_FILE_NAME = ../../common/makefile.base
# include the base makefile
include $(MAKE_FILE_NAME)
The C compiler is likely in the CC variable set in some other makefile, presumably ../../common/makefile.base, (otherwise the default, cc, will be used).
INC_DIR does not look like a place you would add additional C include search path entries. This place looks more appropriate:
USER_INC_DIRS = -I$(SRC_DIR)
Here, you would have to add additional directories with an -I prefix, like this:
USER_INC_DIRS = -I$(SRC_DIR) -I/opt/enyo/include

lib (release) or libd (debug), can Qt resolve this for me?

In the Plug & Paint Example the .pro presents the following:
LIBS = -Lplugins -lpnp_basictools
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
}
Which, for that particular case, appends a d to the lib name in debug mode, pnp_basictools becomes pnp_basictoolsd. But it doesn't scale well, i.e.:
LIBS = -Lplugins -lplugin_1 -lplugin_2 -lplugin_3
if(!debug_and_release|build_pass):CONFIG(debug, debug|release)
win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
Seems not to append d to plugin_2 and plugin_3.
So, may I ask for another method to add the d to the lib name in debug mode?
The issue was also mentioned here.
$$member(X, pos) returns the item at the position pos of the list variable X. So, the code you found only handles 2 of the elements of that list (0 => -Lplugins and 1 => -lpnp_basictools).
There is a for loop that could help you handle all the elements of the list, but instead you can "simply" use a regular expression with the ~= operator :
win32:LIBS ~= s/-l(.*)/-l\1d/g

how to build c++ project with scons 2.3 visual express 2012?

I try:
env = Environment(ENV = {'PATH' : os.environ['PATH'], \
'INCLUDE' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\include\\', \
'LIB' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\lib\\'})
but it not working.
error message:
"cl" is not command ...
I found description in scons wiki(http://www.scons.org/wiki/PlatformSpecificNotes#Visual_C.2B-.2B-):
If using Microsoft Visual C++, you need to set 'INCLUDE', 'LIB' and 'PATH' in your environment, then import them when you create your 'Environment' object. These will be used to locate the MSVC++ tools and set 'CPPFLAGS' etc.
What am I doing wrong?
complete sconstruct(it works on ubuntu, and on windows with mingw):
import os
import sys
if ARGUMENTS.get('ndk', 0):
current_dir = os.getcwd()#os.path.dirname(os.path.abspath(__file__))
os.environ["NDK_PROJECT_PATH"] = current_dir + '/android-project'
os.system("ndk-build") # use V=1 if can't compile for android
exit(0)
if ARGUMENTS.get('ant', 0):
current_dir = os.getcwd()#os.path.dirname(os.path.abspath(__file__))
android_prj_path = current_dir + '/android-project'
os.chdir(android_prj_path)
os.system("ant debug") # use V=1 if can't compile for android
exit(0)
VariantDir('obj', 'src', duplicate = 0)
if sys.platform == 'win32':
if ARGUMENTS.get('msvc', 0) == "1":
env = Environment(ENV = {'PATH' : os.environ['PATH'], \
'INCLUDE' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\include\\', \
'LIB' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\lib\\'})
else:
env = Environment(tools = ['mingw'])
env.Append(CCFLAGS = '-U__STRICT_ANSI__') # for boost::program_options on mingw 4.7
env.Append(LINKFLAGS = '-mwindows')
env.Append(LIBS = ['mingw32', 'SDL2', 'SDL2main', 'm', 'user32', 'gdi32', \
'winmm', 'imm32', 'ole32', 'oleaut32', 'version', \
'uuid', 'glew32', 'opengl32'])
else:
env = Environment()
env.Append(CCFLAGS = '-rdynamic')
env.Append(LIBS = ['SDL2', 'pthread', 'm', 'dl', 'GL'])
env.Append(CCFLAGS = '-fno-strict-aliasing') # for angelscript compile see doc
cur_dir = os.getcwd()
env.Append(CCFLAGS = '-I ' + cur_dir) # for boost find in include path
env.Append(CCFLAGS = '-g -std=c++0x -Wall -Wfatal-errors') #-msse2 -pg
env.Append(LINKFLAGS=[]) # -pg
src = Glob('obj/*.cpp')
src += Glob('obj/scene2d/*.cpp')
src += Glob('obj/pugixml/*.cpp')
src += Glob('obj/debug_support/*.cpp')
src += Glob('obj/angelscript/*.cpp')
src += Glob('obj/scriptarray/*.cpp')
src += Glob('obj/scriptstdstring/*.cpp')
src += Glob('obj/scriptbuilder/*.cpp')
src += Glob('obj/boost_libs_src/program_options/src/*.cpp')
src += Glob('obj/boost_libs_src/smart_ptr/src/*.cpp')
src += Glob('obj/boost_libs_src/system/src/*.cpp')
src += Glob('obj/boost_libs_src/filesystem/src/*.cpp')
src += Glob('obj/libwebp/*/*.c')
src += Glob('obj/zlib/*.c')
src += Glob('obj/libpng/*.c')
env.Program(target = 'start', source = src)
Best way to use scons and MSVC is:
env = Environment( MSVC_USE_SCRIPT = "c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\vcvars32.bat")
Full script that works for me
import os
import sys
current_dir = os.getcwd()#os.path.dirname(os.path.abspath(__file__))
if ARGUMENTS.get('ndk', 0):
os.environ["NDK_PROJECT_PATH"] = current_dir + '/android-project'
os.system("ndk-build") # use V=1 if can't compile for android
Exit(0)
if ARGUMENTS.get('ant', 0):
android_prj_path = current_dir + '/android-project'
os.chdir(android_prj_path)
os.system("ant debug") # use V=1 if can't compile for android
Exit(0)
VariantDir('obj', 'src', duplicate = 0)
if sys.platform == 'win32':
if ARGUMENTS.get('msvc', 0) == "1":
#os.system('"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\vcvars32"')
env = Environment(ENV = {'PATH' : os.environ['PATH'], \
'INCLUDE' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\include\\;c:\\Program Files (x86)\\Windows Kits\\8.0\\Include\um\\;c:\\Program Files (x86)\\Windows Kits\\8.0\\Include\\shared\\', \
'LIB' : 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\lib\\;c:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x86\\'})
env.Append(CCFLAGS = '-I ' + current_dir + '/dep/msvc/include') # for SDL2 on windows
env.Append(CCFLAGS = '/Od /EHsc -DBOOST_ALL_NO_LIB')
env.Append(LINKFLAGS = '/LIBPATH:' + current_dir + '/dep/msvc/lib/')
env.Append(LINKFLAGS = '/SUBSYSTEM:WINDOWS')
env.Append(LIBS = ['user32', 'gdi32', \
'winmm', 'imm32', 'ole32', 'oleaut32', 'version', \
'uuid', 'glew32s', 'opengl32'])
else:
env = Environment(tools = ['mingw'])
env.Append(CCFLAGS = '-U__STRICT_ANSI__') # for boost::program_options on mingw 4.7
env.Append(LINKFLAGS = '-mwindows')
env.Append(LIBS = ['mingw32', 'SDL2', 'SDL2main', 'm', 'user32', 'gdi32', \
'winmm', 'imm32', 'ole32', 'oleaut32', 'version', \
'uuid', 'glew32', 'opengl32'])
else:
env = Environment()
env.Append(LIBS = ['SDL2', 'pthread', 'm', 'dl', 'GL'])
if ARGUMENTS.get('msvc', 0) != "1":
env.Append(CCFLAGS = '-fno-strict-aliasing') # for angelscript compile see doc
env.Append(CCFLAGS = '-std=c++0x -Wall -Wfatal-errors')
env.Append(CCFLAGS = '-I ' + current_dir) # for boost find in include path
if ARGUMENTS.get('release', 0) == "1":
if sys.platform != 'win32':
env.Append(CCFLAGS = '-DNO_OPENGL_CHECK -DSDL_ASSERT_LEVEL=1 -O2 -msse2') #-DNO_OPENGL_CHECK -DSDL_ASSERT_LEVEL=1 -O3 -msse2
else:
env.Append(CCFLAGS = '/MD')
env.Append(LIBS = ['SDLmain', 'SDL', 'msvcrt'])
else:
if sys.platform != 'win32':
env.Append(LINKFLAGS=['-rdynamic']) # $(sdl2-config --static-libs)
env.Append(CCFLAGS = '-g')
else:
env.Append(CCFLAGS = '/MDd /Gm- /Zi -D_DEBUG /Od ')
env.Append(LINKFLAGS=['/INCREMENTAL'])
env['PDB'] = ['start.pdb']
env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}']
env.Append(LIBS = ['SDLmain_d', 'SDL_d', 'MSVCRTD', 'libcmt'])
src = Glob('obj/*.cpp')
src += Glob('obj/scene2d/*.cpp')
src += Glob('obj/pugixml/*.cpp')
src += Glob('obj/debug_support/*.cpp')
src += Glob('obj/angelscript/*.cpp')
src += Glob('obj/scriptarray/*.cpp')
src += Glob('obj/scriptstdstring/*.cpp')
src += Glob('obj/scriptbuilder/*.cpp')
src += Glob('obj/scripthelper/*.cpp')
src += Glob('obj/boost_libs_src/program_options/src/*.cpp')
src += Glob('obj/boost_libs_src/smart_ptr/src/*.cpp')
src += Glob('obj/boost_libs_src/system/src/*.cpp')
src += Glob('obj/boost_libs_src/filesystem/src/*.cpp')
src += Glob('obj/libwebp/*/*.c')
src += Glob('obj/zlib/*.c')
src += Glob('obj/libpng/*.c')
prog = env.Program(target = 'start', source = src)

BB10 cascades c , export build release but Bar file is too huge(100mb)!

Firstly, i am sure i have not done something wrong to export build release bar file, for my project. Few weeks ago i have built one release bar for my project, only 1mb.
I did exactly as the following tutorail:
http://bbcascadescode.tumblr.com/post/33340977264/exporting-bar-file-from-cascades-ide
but today when i try to export the release build, the bar file is about 100mb!!!!
There is no problem, no error, but the bar size is abnormal!!!
this is my project's pro file:
APP_NAME = myProjectName
CONFIG += qt warn_on debug_and_release cascades mobility
LIBS += -lbbdata -lbbplatform -lbbcascadesmaps -lbbsystem -lbbutilityi18n -lbbdevice -lz -lbbcascadesmultimedia -lbbpim -lbbmultimedia -lOpenAL -lalut -lasound
MOBILITY += sensors
include(config.pri)
lupdate_inclusion {
SOURCES += \
$$BASEDIR/../src/*.cpp \
$$BASEDIR/../src/control/*.cpp \
$$BASEDIR/../src/model/*.cpp \
$$BASEDIR/../src/utils/*.cpp \
$$BASEDIR/../src/view/*.cpp \
$$BASEDIR/../assets/items/*.qml \
$$BASEDIR/../assets/controls/*.qml \
$$BASEDIR/../assets/*.qml
}
device {
CONFIG(release, debug|release) {
DESTDIR = o.le-v7
#TEMPLATE = lib
#QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden -mthumb
}
CONFIG(debug, debug|release) {
DESTDIR = o.le-v7-g
}
}
simulator {
CONFIG(release, debug|release) {
DESTDIR = o
}
CONFIG(debug, debug|release) {
DESTDIR = o-g
}
}
OBJECTS_DIR = $${DESTDIR}/.obj
MOC_DIR = $${DESTDIR}/.moc
RCC_DIR = $${DESTDIR}/.rcc
UI_DIR = $${DESTDIR}/.ui
suredelete.target = sureclean
suredelete.commands = $(DEL_FILE) $${MOC_DIR}/*; $(DEL_FILE) $${RCC_DIR}/*; $(DEL_FILE) $${UI_DIR}/*
suredelete.depends = distclean
QMAKE_EXTRA_TARGETS += suredelete
Maybe i import too many libraries??
I have no clue till now, because i got no error, just the bar size seems not correct. It can NOT be 100MB. All the source codes and resource files are only 3.3 MB.
Anyone has the same issue?
Thank you for any advice!!