How to generate OCLint report to html format file? - objective-c

I'm trying to use OCLint as primary code analyzer for my objc project. I follow OCLint guide and get a json file with named "compile_commands.json". But I can't generate it to HTML format file? Anybody can help me? Athought tried a dozen ways but it doesn't work. Any help is appreciate. Thank you
Here is my json file's content, a tiny part
{
"command" : "\/Applications\/Xcode.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/ModuleCache -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS7.0.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=7.0 -iquote \/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/IPSignDoc-generated-files.hmap -I\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/IPSignDoc-own-target-headers.hmap -I\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/IPSignDoc-all-target-headers.hmap -iquote \/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/IPSignDoc-project-headers.hmap -I\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Products\/Debug-iphoneos\/include -I\/Applications\/Xcode.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/include -I\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/DerivedSources\/armv7 -I\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/DerivedSources -F\/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Products\/Debug-iphoneos -include \/Users\/cscv\/Documents\/WORKSPACE_iPOS_iOS\/Main\/IPSignDoc\/IPSignDoc\/IPSignDoc-Prefix.pch -MMD -MT dependencies -MF \/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/Objects-normal\/armv7\/IPSignDoc.d --serialize-diagnostics \/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/Objects-normal\/armv7\/IPSignDoc.dia -c \/Users\/cscv\/Documents\/WORKSPACE_iPOS_iOS\/Main\/IPSignDoc\/IPSignDoc\/IPSignDoc.m -o \/Users\/cscv\/Library\/Developer\/Xcode\/DerivedData\/iPOS-bpnrfhmrxtknspfladklyclnczrw\/Build\/Intermediates\/IPSignDoc.build\/Debug-iphoneos\/IPSignDoc.build\/Objects-normal\/armv7\/IPSignDoc.o",
"file" : "\/Users\/cscv\/Documents\/WORKSPACE_iPOS_iOS\/Main\/IPSignDoc\/IPSignDoc\/IPSignDoc.m",
"directory" : "\/Users\/cscv\/Documents\/WORKSPACE_iPOS_iOS\/Main\/IPSignDoc"
},
And use oclint-json-compilation-database -v oclint_args "-report-type html -o report.html"
But nothing happen!

Below is the script I am using to generate html file.
OCLINT_HOME is the path for oclint downloaded folder. I have renamed the folder to oclintrelease.
OCLINT_HOME=/Users/Dheeraj/Downloads/oclintrelease
export PATH=$OCLINT_HOME/bin:$PATH
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
cd ${TARGET_TEMP_DIR}
if [ ! -f compile_commands.json ]; then
echo "[*] compile_commands.json not found, possibly clean was performed"
echo "[*] starting xcodebuild to rebuild the project.."
# clean previous output
if [ -f xcodebuild.log ]; then
rm xcodebuild.log
fi
cd ${SRCROOT}
xcodebuild clean
#build xcodebuild.log
xcodebuild | tee ${TARGET_TEMP_DIR}/xcodebuild.log
#xcodebuild <options>| tee ${TARGET_TEMP_DIR}/xcodebuild.log
echo "[*] transforming xcodebuild.log into compile_commands.json..."
cd ${TARGET_TEMP_DIR}
#transform it into compile_commands.json
oclint-xcodebuild
fi
echo "[*] starting analyzing"
cd ${TARGET_TEMP_DIR}
oclint-json-compilation-database -v oclint_args "-report-type html -o $OCLINT_HOME/report.html"
Your report would be generated to the provided path in OCLINT_HOME using the above script.
If you want to generate report in your derived data folder then replace the last line with :
oclint-json-compilation-database -v oclint_args "-report-type html -o report.html"
HTML report would be generated if and only if your build is successful and you can check your generated report path and script report into Log Navigator of Xcode.

Related

Cmake: How to include dependecies properly

In the old Makefile there is an include part:
SHELL=/bin/sh
CORE_SRC=\
./Core/allocator.cpp \
./Core/etc... \
CORE_OBJS=$(CORE_SRC:.cpp=.o)
INCLUDE=\
`pkg-config --cflags glib-2.0 libpng` \
`sdl-config --cflags` \
`freetype-config --cflags` \
`./python-config-linux.sh --cflags` \
-I./TopLayer -I./etc...
CC=g++-4.4
CFLAGS=-O3 -pipe -Wall -fPIC -D__STDC_CONSTANT_MACROS
CORE_LFLAGS=\
-fPIC \
-Wl,-rpath,./libs
CORE_LDLIBS=\
`pkg-config --libs glib-2.0 libpng` \
`sdl-config --libs` -lz -ljpeg \
`freetype-config --libs` \
`curl-config --libs` \
-L./$(LIBSDIR) \
-letc...
GAME_LFLAGS=\
-shared -pthread -fPIC \
-Wl,-rpath,../libs
GAME_LDLIBS=\
-lm \
`python-config-linux.sh --libs`
target_name: $(CORE_OBJS) $(CORE_NAME)
target_name: override CFLAGS += -DAV_OUTPUT
$(CORE_NAME): $(CORE_OBJS)
$(CC) $(CORE_LFLAGS) $(CORE_OBJS) $(CORE_LDLIBS) -o $#
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $*.o
.cpp.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $#
The execution of those configs is:
$pkg-config --cflags glib-2.0 libpng
-> -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libpng12
$sdl-config --cflags
-> -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
$freetype-config --cflags
-> -I/usr/include/freetype2
$./python-config-linux.sh --cflags
-> -I/python-2.7.10/include/python2.7 -I/python-2.7.10/include/python2.7 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
I don't understand and a bit confused about Cmake - should I use target_include_dirictories() or find_packages()?
Should target_include_dirictories() be used also with --cflags and libs like glib-2.0 libpng for pkg-config?
*Updated makefile. Removed unnecessary targets etc.
You will need both find_package() and target_link_libraries().
target_include_directories() is almost always obsolete when using libraries found through find_package. Docs.
Example
Example tested on macOS HighSierra with CMake 3.12.
project(Example)
cmake_minimum_required(VERSION 3.10)
find_package(PNG REQUIRED)
add_executable(prog main.c) # main.c from: http://zarb.org/~gc/html/libpng.html
target_link_libraries(prog PNG)
# On Ubuntu 14.04 + CMake 3.2 use the older syntax (FindPNG.cmake is too old) from the next line:
# target_link_libraries(prog ${PNG_LIBRARIES})

Can I build my PC file (Oracle Pro*c) conditionally inside of my application's make file?

I'm attempting to combine my makefiles so I can simply build once and it will precompile the pc file completely before continuing to build the application. This should be possible but for the life of me I cannot figure it out. Here is my makefile (for redhat 7).
COMPILEDATE = $(shell date)
COMPILE=g++ -std=c++11 -Wall -Wuninitialized -g
OSTYPE = $(shell uname)
LIBDIR=../../lib/
INC=../../include/
FILES=myProcess
OBJS= myProcess.o \
sqlStuff.o
O8P=$(ORACLE_HOME)
O8P=/u01/app/oracle/11.2.0/client_1
ORACLE_HOME=/u01/app/oracle/11.2.0/client_1
PROC_LINES=proc lines=yes code=ANSI_C iname=sqlStuff.pc parse=partial iname=sqlStuff include=. include=$(ORACLE_HOME)/precomp/public include=$(ORACLE_HOME)/rdbms/public include=$(ORACLE_HOME)/rdbms/demo include=$(ORACLE_HOME)/plsql/public include=$(ORACLE_HOME)/network/public
all: $(FILES)
compileInfo.o : FORCE
$(COMPILE) -c compileInfo.cpp -o $# -I$(INC) -DCDATE="\"$(COMPILEDATE)\"" -DBUILD="\"$(LSWBUILD)\""
FORCE :
%.o : %.cpp $(INC)myProcess.h
$(COMPILE) -c $< -o $# -I$(INC) -DCDATE="\"$(COMPILEDATE)\""
sqlStuff.o : sqlStuff.c
gcc -g -Wall -O -c -lclntsh -I. -I$(ORACLE_HOME)/precomp/public -I$(ORACLE_HOME)/rdbms/public -I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/plsql/lib -I$(ORACLE_HOME)/network/lib
sqlStuff.c : sqlStuff.pc
$(PROC_LINES)
myProcess: $(OBJS) $(LIBDIR)libbase.a $(INC)myProcess.h sqlStuff.o
$(COMPILE) -o myProcess$(OBJS) -L$(LIBDIR) -lbase
clean:
rm -f $(FILES)
rm -f sqlStuff
rm -f sqlStuff.c
rm -f sqlStuff.lis
rm -f $(OBJS)
rm -f core
rm -f *.out
rm -f *.log
rm -f *.err
My fault, I didn't explain what the issue was:
I'm compiling in netbeans using this build command: ${MAKE} -f Makefile. The error is PCC-S-02015, unable to open include file on my object that is not being precompiled, sqlStuff.o
Looking at the gcc command under sqlStuff.o : sqlStuff.c, it looks to me that there should be a -o sqlStuff.o flag to tell gcc that the output should be written to sqlStuff.o instead of the default, which is a.out.
Best of luck.

Cocoa project without Xcode

I am writing a sample application on Mac OS X using Cocoa.
Things were fine when I was using Xcode to built and debug.
But when I started building by makefile, program is same, every file is same (as shown by diff), output is different.
My first question: Is this makefile to build a cocoa project correct?
Make file is:
CLANG = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
ARCH = x86_64
MIN_VERSION = 10.8
DEBUG_PATH = bin/debug
SYSROOT = /Applications/Xcode.app/Contests/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/
IBTOOL = /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool
SDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
FRAME = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks
LIB = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib
FLAGS = -g -O0
debug: $(DEBUG_PATH)/test.app
run:
open $(DEBUG_PATH)/test.app
$(DEBUG_PATH)/test.app: $(DEBUG_PATH)/test
cp $(DEBUG_PATH)/test $(DEBUG_PATH)/test.app/Contents/MacOS/test
cp en.lproj/credits.rtf $(DEBUG_PATH)/test.app/Contents/Resources/en.lproj
cp en.lproj/InfoPlist.strings $(DEBUG_PATH)/test.app/Contents/Resources/en.lproj
cp PkgInfo $(DEBUG_PATH)/test.app/Contents/
rm -f $(DEBUG_PATH)/test
cp test-core-text-Info.plist $(DEBUG_PATH)/test.app/Contents/Info.plist
touch $#
$(DEBUG_PATH)/test: $(DEBUG_PATH)/AppDelegate.o $(DEBUG_PATH)/main.o
mkdir -p $(DEBUG_PATH)/test.app/Contents/MacOS/../Resources/en.lproj
$(CLANG) -arch $(ARCH) -isysroot $(SYSROOT) -L$(DEBUG_PATH)/ -L$(LIB) -mmacosx-version-min=$(MIN_VERSION) AppDelegate.o main.o -framework Cocoa -o $# -F $(FRAME)
$(IBTOOL) --errors --warnings --notices --output-format human-readable-text --compile $(DEBUG_PATH)/test.app/Contents/Resources/en.lproj/MainMenu.nib en.lproj/MainMenu.xib --sdk $(SDK)
clean:
rm -rf $(DEBUG_PATH)/test.app
rm -f $(DEBUG_PATH)/*
$(DEBUG_PATH)/AppDelegate.o: src/AppDelegate.m
$(CLANG) -arch $(ARCH) $(FLAGS) -Wall -c $< -o $#
$(DEBUG_PATH)/main.o: src/main.m
$(CLANG) -arch $(ARCH) $(FLAGS) -Wall -c $< -o $#
Output of Xcode (run app from anywhere)
Output by makefile
It is still conundrum to me that the program is same, Info.plist is same, nib is same, why the output is different.
What is the thing I am missing?

passenger-install-nginx-module install error

im try to change my webrick to passenger with nginx but when i try
passenger-install-nginx-module
seems everything is alright at first but at the end it comes with this error i tried to Google the problem but some of the post are
unanswered very much appreciated for the helping thanks to all
# sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --add-module='/home/led/.rvm/gems/ruby-1.9.3-rc1/gems/passenger-3.0.0.pre4/ext/nginx'
checking for OS
+ Linux 2.6.42.12-1.fc15.i686 i686
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC)
checking for gcc -pipe switch ... found
checking for gcc variadic macros ... found
checking for C99 variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
configuring additional modules
adding module in /home/led/.rvm/gems/ruby-1.9.3-rc1/gems/passenger-3.0.0.pre4/ext/nginx
checking for Math library ... found
+ ngx_http_passenger_module was configured
checking for PCRE library ... found
checking for OpenSSL library ... found
checking for zlib library ... found
creating objs/Makefile
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system endianess ... little endianess
checking for size_t size ... 4 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 4 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for strerror_r() ... found but is not working
checking for gnu style strerror_r() ... found
checking for sys_errlist[] ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1 library is not used
+ using system zlib library
nginx path prefix: "/opt/nginx"
nginx binary file: "/opt/nginx/sbin/nginx"
nginx configuration prefix: "/opt/nginx/conf"
nginx configuration file: "/opt/nginx/conf/nginx.conf"
nginx pid file: "/opt/nginx/logs/nginx.pid"
nginx error log file: "/opt/nginx/logs/error.log"
nginx http access log file: "/opt/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
# make
make -f objs/Makefile
make[1]: Entering directory `/tmp/root-passenger-5241/nginx-0.7.67'
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/nginx.o \
src/core/nginx.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_log.o \
src/core/ngx_log.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_palloc.o \
src/core/ngx_palloc.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_array.o \
src/core/ngx_array.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_list.o \
src/core/ngx_list.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_hash.o \
src/core/ngx_hash.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_buf.o \
src/core/ngx_buf.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_queue.o \
src/core/ngx_queue.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_output_chain.o \
src/core/ngx_output_chain.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_string.o \
src/core/ngx_string.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_parse.o \
src/core/ngx_parse.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_inet.o \
src/core/ngx_inet.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_file.o \
src/core/ngx_file.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_crc32.o \
src/core/ngx_crc32.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_rbtree.o \
src/core/ngx_rbtree.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_radix_tree.o \
src/core/ngx_radix_tree.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_slab.o \
src/core/ngx_slab.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_times.o \
src/core/ngx_times.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_shmtx.o \
src/core/ngx_shmtx.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_connection.o \
src/core/ngx_connection.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_cycle.o \
src/core/ngx_cycle.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_spinlock.o \
src/core/ngx_spinlock.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_cpuinfo.o \
src/core/ngx_cpuinfo.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_conf_file.o \
src/core/ngx_conf_file.c
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
-o objs/src/core/ngx_resolver.o \
src/core/ngx_resolver.c
src/core/ngx_resolver.c: In function ‘ngx_resolver_process_ptr’:
src/core/ngx_resolver.c:1422:32: error: variable ‘qclass’ set but not used [-Werror=unused-but-set-variable]
src/core/ngx_resolver.c:1422:25: error: variable ‘qtype’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[1]: *** [objs/src/core/ngx_resolver.o] Error 1
make[1]: Leaving directory `/tmp/root-passenger-5241/nginx-0.7.67'
make: *** [build] Error 2
You're using v3.0.0.pre4 of the passenger gem, which was release in September of 2010.
Passenger is now at v3.0.11. I'd suggest updating passenger: gem update passenger and running passenger-install-nginx-module again.

Prepending a path on make

In my makefile I have an object variable. I need to prepend obj/ to every .o file. How would I do this?
CC=g++
CFLAGS=-C -Wall
LDFLAGS=-lsqlite3 -lpthread -ldl
SOURCES=main.cpp Database.cpp actionInit.cpp TileSet.cpp Player.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=mahjong-counter
all: bin $(OBJECTS) $(EXECUTABLE)
bin:
mkdir -p bin
%.o: %.cpp
$(CC) $(LDFLAGS) $< -c -o $#
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $(EXECUTABLE)
clean:
rm $(OBJECTS)
You want CXX, not CC. CC is for C compiler, not the C++ compiler
In any case, I believe the following should work:
CXX=g++
CXXFLAGS=-C -Wall
LDFLAGS=-lsqlite3 -lpthread -ldl
OBJ_DIR = obj
BIN_DIR = bin
EXECUTABLE=mahjong-counter
SOURCES= main.cpp Database.cpp actionInit.cpp TileSet.cpp Player.cpp
OBJECTS= $(SOURCES:%.cpp=$(OBJ_DIR)/%.o)
all: dirs $(OBJECTS) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $(EXECUTABLE)
$(OBJ_DIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) $< -o $#
dirs:
mkdir -p $(BIN_DIR)
mkdir -p $(OBJ_DIR)
.PHONY: dirs all
You could use more expressive version of substitution you employed when assigning OBJECTS
OBJECTS=$(SOURCES:%.cpp=obj/%.o)
or use a standard text transformation function
OBJECTS=$(addprefix obj/,$(SOURCES:.cpp=.o))