Generic Makefile: Difference between revisions

From genomewiki
Jump to navigationJump to search
No edit summary
 
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
include ../common.mk
<pre>
include $(KENT)/src/inc/common.mk
include ${KENT}/src/inc/common.mk


CFLAGS=-I ${KENT}/src/inc -I ${KENT}/src/hg/inc -g
CFLAGS=-I ${KENT}/src/inc -I ${KENT}/src/hg/inc  
L = -lm $(MYSQLLIBS)
L += -lm ${MYSQLLIBS}
MYLIBDIR = $(KENT)/src/lib/$(MACHTYPE)
MYLIBDIR = ${KENT}/src/lib/${MACHTYPE}
MYLIBS =  $(MYLIBDIR)/jkhgap.a $(MYLIBDIR)/jkweb.a
MYLIBS =  ${MYLIBDIR}/jkhgap.a ${MYLIBDIR}/jkweb.a  


O = bedFlanking.o ../lib/bedUtil.o
O = ${PROG}.o ../lib/bedUtil.o


bedFlanking: $O $(MYLIBS)
${PROG}: $O ${MYLIBS}
         ${CC} ${COPT} ${CFLAGS}  -o $(HOME)/bin/$(MACHTYPE)/bedFlanking $O $(MYLIBS) $L
         ${CC} ${COPT} ${CFLAGS}  -o ${HOME}/bin/${MACHTYPE}/${PROG} $O ${MYLIBS} $L
         strip $(HOME)/bin/$(MACHTYPE)/bedFlanking
         strip ${HOME}/bin/${MACHTYPE}/${PROG}


e:
clean:
         vim bedFlanking.c
         rm *.o
 
         rm core
splint: bedFlanking.c
        splint -weak $(CFLAGS) bedFlanking.c
 
run: bedFlanking
         bedFlanking -concat test/regions.bed test/genes.bed stdout
 
test1: bedFlanking
        bedFlanking -concat test/5-short.bed test/jgi-exons.bed stdout


symbols: $O $(MYLIBS) maxfa.c
</pre>
        ${CC} ${COPT} ${CFLAGS}  -o $(HOME)/bin/$(MACHTYPE)/bedFlanking $O $(MYLIBS) $L


corefile: core
Make sure that the four indented lines are indented with tabs, otherwise the file will not work.
        gdb bedFlanking core
debug:
        gdb --args


tags: bedFlanking.c
See also: the <em>newProg</em> command in the kent source tree. It will generate not only a generic Makefile but also the generic structure of a kent source utility.
        ctags *.c
 
clean:
        rm *.o
        rm core


test: bedFlanking.c
Please note, it is convenient to use the {curlyBraces} instead of (parens) for variables, since the lines can then be cut and pasted into a command line when need be.  They work the same way in a Makefile, but not on a command line.
        bedFlanking
       


# DO NOT DELETE
[[Category:Browser Development]]

Latest revision as of 20:55, 20 November 2014

include ${KENT}/src/inc/common.mk

CFLAGS=-I ${KENT}/src/inc -I ${KENT}/src/hg/inc 
L += -lm ${MYSQLLIBS}
MYLIBDIR = ${KENT}/src/lib/${MACHTYPE}
MYLIBS =  ${MYLIBDIR}/jkhgap.a ${MYLIBDIR}/jkweb.a 

O = ${PROG}.o ../lib/bedUtil.o

${PROG}: $O ${MYLIBS} 
        ${CC} ${COPT} ${CFLAGS}  -o ${HOME}/bin/${MACHTYPE}/${PROG} $O ${MYLIBS} $L
        strip ${HOME}/bin/${MACHTYPE}/${PROG}

clean:
        rm *.o
        rm core

Make sure that the four indented lines are indented with tabs, otherwise the file will not work.

See also: the newProg command in the kent source tree. It will generate not only a generic Makefile but also the generic structure of a kent source utility.

Please note, it is convenient to use the {curlyBraces} instead of (parens) for variables, since the lines can then be cut and pasted into a command line when need be. They work the same way in a Makefile, but not on a command line.