Makefile 3.9 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
###########################################################################
# Automatically generated by comake (1.0.0)  							  #
###########################################################################

#################设计系统参数#######################################
WORKROOT	?=	../../../../
IDLCC	?=	$(WORKROOT)/public/idlcompiler/output/bin/mcy
CC	?=	gcc
CXX	?=	g++
LEX	?=	flex
YACC	?= yacc
CFLAGS	?=	-pipe -fsigned-char -Wall -W -g -fPIC
CXXFLAGS	?=	-pipe -fsigned-char -Wall -W -g -fPIC
LEXFLAGS	?=	
YACCFLAGS	?=	
LINKFLAGS	?=  -rdynamic
LINK	?=	g++
AR	?=	ar cqs
RANLIB	?=	
COMAKE	?=	comake

###############baidu lib 的32位 64位支持#################
ifeq ($(MAC), 64)
	lib2=lib2-64
	third=third-64
else
	lib2=lib2
	third=third
endif
ifeq ($(MAC),ARM32)
	lib2=lib2-arm32
	third=third-arm32
endif
##########################################

# 编译参数
DEP_INCPATH =  -I$(WORKROOT)/$(lib2)/bsl//include/
DEP_LDFLAGS =  -L$(WORKROOT)/$(lib2)/bsl//lib/
DEP_LDLIBS = -lbsl_archive -lbsl_exception -lbsl_pool -lbsl_utils -lbsl -lbsl_ResourcePool -lbsl_check_cast -lbsl_var -lbsl_var_implement
MAKDEP = Makefile.dep


#start target
first : all

############# 默认推到公式
.SUFFIXES: .c .cpp .cc .cxx .C .idl .des

.cpp.o:
	$(CXX) -c -o $@ $<  $(CXXFLAGS) $(CPPFLAGS) $(INCPATH)

.cc.o:
	$(CXX) -c -o $@ $<  $(CXXFLAGS) $(CPPFLAGS) $(INCPATH)

.cxx.o:
	$(CXX) -c -o $@ $<  $(CXXFLAGS) $(CPPFLAGS) $(INCPATH)

.C.o:
	$(CXX) -c -o $@ $<  $(CXXFLAGS) $(CPPFLAGS) $(INCPATH)

.c.o:
	$(CC) -c -o $@ $<  $(CFLAGS) $(CPPFLAGS) $(INCPATH)

.idl.cpp:
	$(IDLCC) --ns=$(*F) -o $* $< $(CPPFLAGS) $(INCPATH)

#############
###cpp 支持
%info : %
	ccp $<
#############


#__$MAKEFILE_RULES$__


###############编译目标
all :  target output 
.PHONY : all clean main 

target : main 

test : 
	`for x in  ;do ./$$x;done`

comake :
	-make clean
	-comake 

#-include $(MAKDEP)

#----------------build target : main--------------------

main : CC := gcc
main : CXX := g++
main : CXXFLAGS := -pipe -fsigned-char -Wall -W -g -fPIC
main : CPPFLAGS := 
main : CFLAGS := -pipe -fsigned-char -Wall -W -g -fPIC
main : INCPATH :=  -I. -I../output/include $(DEP_INCPATH)
main : LDLIBS := -lidlcompiler $(DEP_LDLIBS)
main : LDFLAGS :=  -L../output/lib $(DEP_LDFLAGS)
main : LINKFLAGS := -rdynamic

main_SOURCES := $(wildcard comake_autogen.cpp main.cpp)
#main_HEADERS := $(wildcard *.h)
main_HEADERS := *.h
main_IDLSRC := $(wildcard __$IDLSRC_VALUE$__)
main_IDLSRCCPP := $(patsubst %.idl,%.cpp, $(main_IDLSRC))
main_IDLSRCH := $(patsubst %.idl,%.h, $(main_IDLSRC))
main_CONFDES := $(wildcard __$CONFDES$_VALUE$__ main.des)
main_CONFRANGE := $(patsubst %.des,%.range, $(main_CONFDES))
main_OBJS := $(main_IDLSRC:.idl=.o)
main_OBJS += $(main_SOURCES:.c=.o)
main_OBJS := $(main_OBJS:.cc=.o)
main_OBJS := $(main_OBJS:.cpp=.o)
main_OBJS := $(main_OBJS:.cxx=.o)
main_OBJS := $(main_OBJS:.C=.o)
main_OBJS := $(main_OBJS:.idl=.o)
main_OBJS := $(main_OBJS:.yacc=.o)
main_OBJS := $(main_OBJS:.lex=.o)
main : $(main_OBJS)
	`for x in $(main_CONFDES);do cpp -C -o main.range $$x $(CPPFLAGS) $(INCPATH);mkdir -p conf;cp main.range conf/; done`
	$(LINK) $^ -o $@ -Xlinker "-(" $(LDFLAGS) $(LDLIBS) $(LINKFLAGS) -Xlinker "-)"


define main_output
	mkdir -p output
	cp -rf main output
	`if [ -e "conf" ];then cp -rf conf output/ ;fi`

endef
	

define main_clean
	-rm -rf $(main_OBJS) $(main_IDLSRCCPP) $(main_IDLSRCH) main.range conf/main.range
	-rm -rf main
	-rm -rf output
	-rm -rf ccp_output.error   ccp_output_scm.xml  ccp_output.xml ccp_output.pclint  ccp_output.txt
endef
	

define main_ccpc
	ccp $(main_SOURCES) --formatter vim
endef
	

define main_cov
	
endef
	



#---------------------end build target : main------------------

define _output
	$(main_output)
endef
	

define _clean
	$(main_clean)
endef
	

ccpc :
	$(main_ccpc)

cov :
	cov01 -1
	make clean
	make 
	cov01 -0



output : main 
	$(_output)

$(MAKDEP) : comake_autogen.cpp main.cpp
	-$(CC) -MG -MM $(CPPFLAGS) $(INCPATH) $(DEP_INCPATH) $^ > $@


clean:
	$(_clean)
	rm -rf $(MAKDEP)