Makefile 5.5 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 189 190 191 192 193 194 195 196 197 198 199 200 201 202
###########################################################################
# Automatically generated by comake (1.0.0)  							  #
###########################################################################

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

###############baidu lib 的32位 64位支持#################
HARDWARE_PLATFORM := $(shell uname -m)
ifeq ($(HARDWARE_PLATFORM),x86_64)
    lib2=lib2-64
	third=third-64
else
    lib2=lib2-arm32
	third=third-arm32
endif
##########################################

# 编译参数
DEP_INCPATH =  -I$(WORKROOT)/public/spreg/output//include/ -I$(WORKROOT)/$(lib2)/ullib//include/ -I$(WORKROOT)/$(third)/pcre//include/ -I$(WORKROOT)/$(lib2)/bsl//include/
DEP_LDFLAGS =  -L$(WORKROOT)/$(lib2)/bsl//lib/ -L$(WORKROOT)/$(third)/pcre//lib/ -L$(WORKROOT)/$(lib2)/ullib//lib/ -L$(WORKROOT)/public/spreg/output//lib/
DEP_LDLIBS = -lspreg -lpcre -lpcrecpp -lpcreposix -lbsl -lullib
INCPATH =  -I. -Icompiler/src
MAKDEP = Makefile.dep


#start target
first : all

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

.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) $(IDLFLAGS)

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


#__$MAKEFILE_RULES$__



###############编译目标
all :  target output 
.PHONY : all clean test output comake src conf 

target : libconfig.a 
#target : rpcidl libconfig.a 
#target : 
#__$target_CMDLINE$__

rpcidl : 

clean_rpcidl : 


test : 


comake :
	-make clean
	-comake 

#-include $(MAKDEP)
-include $(MAKDEP)

#----------------build target : libconfig.a--------------------

libconfig.a : CC := g++
libconfig.a : CXX := g++
libconfig.a : CXXFLAGS := -pipe -fsigned-char -Wall -W -g -fPIC -Woverloaded-virtual
libconfig.a : CPPFLAGS := 
libconfig.a : IDLFLAGS := 
libconfig.a : CFLAGS := -pipe -fsigned-char -Wall -W -g -fPIC
libconfig.a : INCPATH :=  -I. -Icompiler/src $(DEP_INCPATH)
libconfig.a : LDLIBS := -lm -lpthread $(DEP_LDLIBS)
libconfig.a : LDFLAGS :=  $(DEP_LDFLAGS)
libconfig.a : LINKFLAGS := -rdynamic

libconfig_a_SOURCES := $(wildcard comake_autogen.cpp FileReloader.cpp ConfigReloader.cpp CmdOption.cpp ConfigError.cpp ConfigGroup.cpp ConfigUnit.cpp Configure.cpp constraint/Constraint.cpp constraint/ConstraintFunction.cpp constraint/cc_default.cpp reader/RawData.cpp reader/Reader.cpp utils/init.cpp utils/trans.cpp cfgext.cpp cfgflag.cpp compiler/src/idl.c compiler/src/idl_lex.c compiler/src/idl_gram.c)
#libconfig_a_HEADERS := $(wildcard *.h)
libconfig_a_HEADERS := *.h
libconfig_a_IDLSRC := $(wildcard __$IDLSRC_VALUE$__)
libconfig_a_IDLSRCCPP := $(patsubst %.idl,%.cpp, $(libconfig_a_IDLSRC))
libconfig_a_IDLSRCH := $(patsubst %.idl,%.h, $(libconfig_a_IDLSRC))
libconfig_a_CONFDES := $(wildcard __$CONFDES$_VALUE$__ libconfig.a.des)
libconfig_a_CONFRANGE := $(patsubst %.des,%.range, $(libconfig_a_CONFDES))
libconfig_a_OBJS := $(libconfig_a_IDLSRC:.idl=.o)
libconfig_a_OBJS += $(libconfig_a_SOURCES:.c=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.cc=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.cpp=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.cxx=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.C=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.idl=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.yacc=.o)
libconfig_a_OBJS := $(libconfig_a_OBJS:.lex=.o)
libconfig.a : $(libconfig_a_OBJS) 
	rm -f $@ || echo 
	ar cr $@ $^


define libconfig_a_output
	mkdir -p output output/lib output/include output/include/utils output/include/constraint
	cp -rf *.h output/include/
	cp -rf utils/*.h  output/include/utils/
	cp -rf constraint/*.h output/include/constraint/
	cp -rf compiler/src/idl_conf_if.h output/include/
	cp libconfig.a output/lib
endef
	

define libconfig_a_clean
	-rm -rf $(libconfig_a_OBJS) $(libconfig_a_IDLSRCCPP) $(libconfig_a_IDLSRCH) libconfig.a.range conf/libconfig.a.range
	-rm -rf libconfig.a
	-rm -rf output
	-rm -rf ccp_output.error   ccp_output_scm.xml  ccp_output.xml ccp_output.pclint  ccp_output.txt
endef
	

define libconfig_a_ccpc
	ccp $(libconfig_a_SOURCES) --formatter vim
endef
	

define libconfig_a_cov
	
endef
	



#---------------------end build target : libconfig.a------------------

define _output
	$(libconfig_a_output)
endef
	

define _clean
	$(libconfig_a_clean)
endef
	

ccpc : 
	$(libconfig_a_ccpc)

cov : 
	cov01 -1
	make clean
	make 
	cov01 -0



output : libconfig.a 
	$(_output)
	rm -rf $(MAKDEP)

$(MAKDEP) : $(wildcard comake_autogen.cpp FileReloader.cpp ConfigReloader.cpp CmdOption.cpp ConfigError.cpp ConfigGroup.cpp ConfigUnit.cpp Configure.cpp constraint/Constraint.cpp constraint/ConstraintFunction.cpp constraint/cc_default.cpp reader/RawData.cpp reader/Reader.cpp utils/init.cpp utils/trans.cpp cfgext.cpp cfgflag.cpp compiler/src/idl.c compiler/src/idl_lex.c compiler/src/idl_gram.c)
	-$(CC) -MG -MM $(CPPFLAGS) $(INCPATH) $(DEP_INCPATH) $^ > $@

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