Solved

Makefile help

Posted on 2010-08-24
4
609 Views
Last Modified: 2012-05-10
OOCFG=/home/y/share/ya_cfg
include $(OOCFG)/Make.defs

# Set the list of C++ source files here
CXXSRC  = \
        thFailed.C \
        ResponseCode.C \
        ia_log.C \
        dh_logger.C \
        p_th_plain.C \
        p_th_mycookie.C \
        p_th_myecookie.C \
        p_th_mycookieb64.C \
        p_th_mypki.C \
        mod_ail_p_th.C \
        p_th.C \
        $(NULL)

EXPORTED_LIBPATH_DISABLE=yes

LIB_NAME        = apache_mod_ail_p_th
SHLIB_VERSION = handler

LDEF    =  -g -O2 -Wall -Wimplicit -Werror -Wwrite-strings \
        $(LBSD_FLAG) -DEAPI $(EXTRALDEFS)  $(LDEBUGGING) \
        -D_FILE_OFFSET_BITS=64 \
                $(NULL)
#               -DDH_LOG

LINC    =       \
                -I$(ROOT)/include/ail/common \
                -I$(ROOT)/include/ail/rocket/common \
                -I$(ROOT)/include/ailext \
                -I/usr/local/include

LLDLIBS = \
                -lail_login \
                -lydod_login \
                -lailext \
                -lRocketStat \
                -lyax \
                -lyck \
                -lyprof \
                -lm \
                -lycfl \
                -lminers_dh_logconverter \
                -lminers_dh_log \
                                        $(NULL)

                        ifeq ($(YMK_OS),FreeBSD)
                        LLDLIBS += \
                                -lcompat \
                                -lminers_dh_ynet_sender \
                                $(NULL)
                        else
                        # Linux
                        LLDLIBS += \
                                -lyut_datetime \
                                $(NULL)
                        endif

                        # Set the following variables as necessary to customize this directory
                        # Do not add any build rules until *after* the include of Make.cfg
                        # If this is a directory with subdirectories to build, set SUBDIRS
                        SUBDIRS =

                        include $(OOCFG)/Make.rules
                        # Do not place any rules or targets above this line

                        # Include Buildyblocks rules
                        include /home/y/share/ya_cfg/buildyblocks/Make.rules
                        BUILDYBLOCKS_DIR=./build/buildyblocks
                        OS_PLATFORM=$(shell inst platform os)
                        STATE_FILE=build_$(OS_PLATFORM).state
                        HOST_NAME=apache_mod_ail_p_th.build.mail.corp.ya.com:apache_mod_ymai
                        l_p_th_$(OS_PLATFORM)_build

                        update-state-file:
                                /home/y/libexec/mail/ymGetBuildState.pl -host $(HOST_NAME) -directory $(
                        BUILDYBLOCKS_DIR) || exit $$?
                                /usr/local/bin/inst restore -file $(BUILDYBLOCKS_DIR)/$(STATE_FILE) ||
                        /home/y/bin/svn revert $(BUILDYBLOCKS_DIR)/$(STATE_FILE)
                                /home/y/bin/svn commit -m"Auto-updated $(BUILDYBLOCKS_DIR)/$(STATE_FILE)
                        " $(BUILDYBLOCKS_DIR)/$(STATE_FILE) || exit $$?

                        clean::
                                $(MAKE) -C ./unit-tests clean
                                $(MAKE) -C ./package clean
                                $(MAKE) -C ./package/conf clean

                        commit:: update-state-file clean all
                        
                        
                                $(MAKE) -C ./unit-tests cppunit
                                $(MAKE) -C ./package commit
                                $(MAKE) -C ./package/conf commit

                        SECONDARY_BIM=./build/buildyblocks/secondary_build.bim
                        secondary: BB_BIM_FILE=$(SECONDARY_BIM)

                        secondary-build: update-state-file clean all
                                $(MAKE) -C ./unit-tests cppunit
                                $(MAKE) -C ./package secondary

                        secondary-build-conf:
                                $(MAKE) -C ./package/conf secondary

                        ifeq ("$(OS)", "rhel")
                        secondary: secondary-build BB_Dist_Push
                        else
                        secondary: secondary-build secondary-build-conf BB_Dist_Push
                        endif
                                                
0
Comment
Question by:Vlearns
  • 2
4 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 33516907
Nice makefile - what's the question?
0
 

Author Comment

by:Vlearns
ID: 33516911
hi

i have the makefile above and i need to add code coverage using the coverity tool....
am new to makefiles and am trying to understand what this file is doing...

cxxsrc seems to indicate the code files

what do ldef, lic lldlibs do?

how do i add coverity to this makefile, has anyone ttied it before?
i am on freebsd

thanks


0
 
LVL 12

Accepted Solution

by:
w00te earned 500 total points
ID: 33522477
LDEF is a short macro/alias for your compiler commands, LLDLIBS seems to be a macro for pullin gin the required libraries (it does some based on OS type, so yours will follow the freeBSD path it has noted).  LINC looks like its pulling in headers common to the project.
OOCFG=/home/y/share/ya_cfg is another macro/alias for a directory which seems to contain the makefile with build rules:  Make.rules
clean:: nice macro that you can use such as:
make clean
to remove all files built by the make file when you run it.
and as you probably noticed, you can use these marcros/aliases after definition with the $(name) syntax.
-w00te
0
 
LVL 12

Expert Comment

by:w00te
ID: 33522492
and I've never used coverity, so I'm tagging out :p sorry man!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now