I want to insert ifndef in the makefile inside export
And it seems that there is no possibility
export LINKER_INCLUDE_FILES:=$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4/cr4_cpu.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4/cr4_fpinit.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4/cr4_startup.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4/cr4_vfpinit.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4_0/cr4_mpu.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/platform/one/r4_0/isr.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/config/one/bmw/r4_0/sys_resource_tables.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/app/unit_tests/cantata_infra/invz_printf.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/infra/hw/hw_access.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/infra/hw/regs.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/drivers/uart/uart_drv.o \
ifndef TEST_TIMER
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/drivers/timers/timer.o \
endif
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/drivers/vic/vic.o \
$(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/drivers/clock_and_reset/clock_and_reset.o
Certainly that can't work.
You can just use:
export LINKER_INCLUDE_FILES := ... \
ifndef TEST_TIMER
LINKER_INCLUDE_FILES += $(BASE_PATH)/build/one/bmw/r4_0_cantata/Deploy/src/drivers/timers/timer.o
endif
E.g., put all the values into the variable, then use ifndef to += extra variables.
I am trying write plugin to generate validate go files. Which uses https://github.com/mwitkow/go-proto-validators and envoy proxy validator https://github.com/envoyproxy/protoc-gen-validate. Below is my command
protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/pkg/mod/github.com/gogo/protobuf#v1.3.2 \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.1.0
--proto_path=. \
--gogo_out=. \
—-validate_out=“lang=go:.\”
--govalidators_out=gogoimport=true:. \
proto/*.proto
when I run above command I am getting below error? any suggestion expert on how to resolve this. Appreciate your help.
zsh: command not found: --proto_path=.
zsh: command not found: --govalidators_out=gogoimport=true:.
After adding the missing "/"
protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/pkg/mod/github.com/gogo/protobuf#v1.3.2 \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.1.0 \
--proto_path=. \
--gogo_out=. \
-—go_out=":./generated" \
—-validate_out="lang=go:./generated" \
--govalidators_out=gogoimport=true:. \
proto/test.proto
I am getting Unknown flag: -?
you missed \ after get-validate and later...
protoc \
--proto_path=${GOPATH}/src \
--proto_path=${GOPATH}/pkg/mod/github.com/gogo/protobuf#v1.3.2 \
--proto_path=${GOPATH}/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.1.0 \
--proto_path=. \
--gogo_out=. \
—-validate_out="lang=go:." \
--govalidators_out=gogoimport=true:. \
proto/*.proto
How can I avoid rebuilding of targets every time even though there are no changes to them? I have looked at these answers: answer1, answer2, answer3, but I still could not solve my problem. I think I understand conceptually why this problem occurs. It is just that I was unable to apply the solutions to my case.
Here is my makefile:
.PHONY: all dircreate dircreate_sub
# Create shortcuts to directories ##############################################
DAT4 = data/4-Year/
RES4 = data/results/4-Year/
FIG4 = figures/4-Year/
DAT2 = data/2-Year/
RES2 = data/results/2-Year/
FIG2 = figures/2-Year/
DEPVARS = \
ret.1st.2nd.term.left \
ret.1st.2nd.year.left \
ret.1st.7th.year.grad \
ret.1st.5th.year.grad
# Create directories ###########################################################
dircreate:
mkdir -p \
data/ \
data/4-Year/ \
data/2-Year/ \
data/results/ \
data/results/4-Year \
data/results/2-Year \
figures/ \
figures/4-Year/ \
figures/2-Year/
dircreate_sub:
for d in $(DEPVARS); do \
mkdir -p data/4-Year/$$d ; \
mkdir -p data/2-Year/$$d ; \
mkdir -p data/results/4-Year/$$d ; \
mkdir -p data/results/2-Year/$$d ; \
mkdir -p figures/4-Year/$$d ; \
mkdir -p figures/2-Year/$$d ; \
done;
#TARGETS_DATAPREP := \
#$(foreach dat, $(DAT4) $(DAT2), $\
# $(foreach filename, \
# train_index_outer.RDS \
# train_outer.RDS \
# train_inter_outer.RDS, $\
# $(foreach depvar, $(DEPVARS),$(dat)$(depvar)/$(filename))))
# Data prep:####################################################################
TARGETS_DATAPREP := \
$(foreach filename, $\
train_index_outer.RDS \
train_outer.RDS \
train_inter_outer.RDS \
entire_data.RDS \
entire_inter_data.RDS, $\
$(foreach depvar, $(DEPVARS),$(DAT4)$(depvar)/$(filename)))
$(TARGETS_DATAPREP): \
dataprep.R \
funcs.R \
../core/data/analysis.data.RDS
Rscript $<
# benchmark:####################################################################
DEPENDENCIES_BENCHMARK := \
$(foreach filename, $\
train_index_outer.RDS \
train_outer.RDS \
train_inter_outer.RDS \
entire_data.RDS \
entire_inter_data.RDS, $\
$(foreach depvar, $(DEPVARS),$(DAT4)$(depvar)/$(filename)))
TARGETS_BENCHMARK := \
$(foreach filename, $\
logreg_inner.RDS \
l1logreg_inner.RDS \
l1logreg.int_inner.RDS \
rf_inner.RDS \
xgb_inner.RDS \
logreg_outer.RDS \
l1logreg_outer.RDS \
l1logreg.int_outer.RDS \
rf_outer.RDS \
xgb_outer.RDS, $\
$(foreach depvar, $(DEPVARS),$(RES4)$(depvar)/$(filename)))
$(TARGETS_BENCHMARK): \
benchmark.R \
funcs.R \
$(DEPENDENCIES_BENCHMARK)
Rscript $<
# Process:######################################################################
TARGETS_PROCESS := \
$(foreach filename, $\
processed_inner.RDS \
processed_inner_outer.RDS, $\
$(foreach depvar, $(DEPVARS),$(RES4)$(depvar)/$(filename)))
$(TARGETS_PROCESS): \
process.R \
funcs.R \
$(TARGETS_BENCHMARK)
Rscript $<
# Graphs:#######################################################################
TARGETS_GRAPHS := \
$(foreach filename, $\
ave_auc_inner.png \
ave_ppv10_inner.png \
dist_auc_inner.png \
dist_ppv10_inner.png \
roc_inner.png \
ave_auc_outer.png \
ave_ppv10_outer.png \
dist_auc_outer.png \
dist_ppv10_outer.png \
roc_outer.png \
ave_auc_ppv10_inner_outer.png \
roc_inner_outer.png \
thresh_inner_outer.png, $\
$(foreach depvar, $(DEPVARS),$(FIG4)$(depvar)/$(filename)))
$(TARGETS_GRAPHS): \
graphs.R \
funcs.R \
$(TARGETS_PROCESS)
Rscript $<
# Make all
all: $(TARGETS_PROCESS)
So, the make -nd tells me dircreate needs to be remade every time. That's why I also tried adding a variable called, say, OUTDIRS and also created a rule for it. So, instead of dircreate, I added this bit:
OUTDIRS: $(DAT4) $(RES4) $(FIG4) $(DAT2) $(RES2) $(FIG2)
OUTDIRS := \
for d in $(DEPVARS); do \
$(DAT4)$$d ; \
$(DAT2)$$d ; \
$(RES4)$$d ; \
$(RES2)$$d ; \
$(FIG4)$$d ; \
$(FIG2)$$d ; \
done;
$(OUTDIRS):
mkdir -p $#
But, this time I get a missing separator error at $(OUTDIRS): mkdir -p $#, which, I know, is unrelated to the main question, but I am wondering if the way I am going about is at least on the right track?
Suppose you have
DIRS := 2-Year 4-Year
DEPVARS := term year
and you want to construct:
2-Year/term 2-Year/year 4-Year/term 4-Year/year
You can do it this way:
OUTDIRS := $(foreach d,$(DIRS),$(addprefix $(d)/,$(DEPVARS)))
And once you have that working you can abstract it into a function:
Multiply= $(foreach d,$(1),$(addprefix $(d)/,$(2)))
OUTDIRS:=$(call Multiply, $(DIRS), $(DEPVARS))
And one you have that working you can use it to construct those trees of yours:
DIRS := data data/results figures
DIRS := $(DIRS) $(call Multiply, $(DIRS), 4-Year 2-Year)
DEPVARS := $(addprefix ret.1st., 2nd.term.left 2nd.year.left 7th.year.grad 5th.year.grad)
OUTDIRS:=$(call Multiply, $(DIRS), $(DEPVARS))
$(OUTDIRS):
mkdir -p $#
Note that if you want Make to create whichever of those directories don't exist, you must add another rule before the $(OUTDIRS) rule:
.PHONY: all-dirs
all-dirs: $(OUTDIRS)
I'm trying to compile php 5.6 on OsX Mavericks but in the middle of linking process I am receiving this error and do not know what to do with it.
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_do_convert in gdkanji.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
...
"_libiconv_close", referenced from:
_do_convert in gdkanji.o
_convert in encodings.o
"_libiconv_open", referenced from:
_do_convert in gdkanji.o
_convert in encodings.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1
This is my configure options:
sudo ./configure --prefix=/opt/local \
--mandir=/usr/share/man \
--enable-maintainer-zts \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/Library/Server/Web/Config/php \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--disable-cgi \
--with-curl=/usr \
--enable-dba \
--enable-exif \
--enable-fpm \
--enable-ftp \
--with-gd \
--with-freetype-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local \
--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local \
--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local \
--enable-gd-native-ttf \
--with-icu-dir=/usr \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--with-libedit=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pear \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-readline=/usr \
--enable-shmop \
--with-snmp=/usr
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-tidy \
--enable-wddx\
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--enable-zip \
--with-pcre-regex=/opt/local \
--with-vpx-dir=/usr/local/Cellar \
--with-xpm-dir=no
Any help determining the issue would be greatly appreciated. I have tried rebuilding libiconv with no success in fixing the issue. The backslashes on my configure options was put there to break up the really long line of options to make it more readable here so please dont correct me on that in the case that you think that might be the issue. Thanks in advance.
i have added a module to ns2 and i am compiling it when i get undefined reference error.
g++ -o ns \
-lXext -lX11 -lnsl -ldl -lm -lm -lrt -lneoclassic -lxml
maser/mamas.o: In function `mamasReasoner::mamasReasoner()':
mamas.cc:(.text+0x95): undefined reference to `NeoEnvironment::initFromNs(std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&, std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&, int)'
maser/mamas.o: In function `mamasReasoner::build_ontology_tree(knBase&)':
mamas.cc:(.text+0x1c84): undefined reference to `NeoEnvironment::evaluateCommand(String const&)'
maser/mamas.o: In function `NeoEnvironment::readXmlFromMemory(char const*, char const*)':
mamas.cc:(.text._ZN14NeoEnvironment17readXmlFromMemoryEPKcS1_[NeoEnvironment::readXmlFromMemory(char const*, char const*)]+0x14): undefined reference to `Parser::readXmlFromMemory(char const*, char const*)'
collect2: ld returned 1 exit status
make: *** [ns] Error
the library which it is asking for is present at the /usr/local/lib/libneoclassic.so and the makefile can be seen here http://pastebin.com/NZWPxKht
which use the following code for linking.
LINK = g++
LDFLAGS = -lneoclassic -lrt -lxml2
LDOUT = -o $(BLANK)
LIB = \
-L/usr/local/lib -ltclcl -L/usr/local/lib -lotcl -L/usr/local/lib -ltk8.4 -L/usr/local/lib -ltcl8.4 \
-lXext -lX11 \
-lnsl -ldl \
-lm -lm
OBJ_CC = \
tools/random.o tools/rng.o tools/ranvar.o common/misc.o common/timer-handler.o \
common/scheduler.o common/object.o common/packet.o \
common/ip.o routing/route.o common/connector.o common/ttl.o \
trace/trace.o trace/trace-ip.o \
classifier/classifier.o classifier/classifier-addr.o \
classifier/classifier-hash.o \
classifier/classifier-virtual.o \
classifier/classifier-mcast.o \
classifier/classifier-bst.o \
classifier/classifier-mpath.o mcast/replicator.o \
classifier/classifier-mac.o \
classifier/classifier-qs.o \
classifier/classifier-port.o src_rtg/classifier-sr.o \
src_rtg/sragent.o src_rtg/hdr_src.o adc/ump.o \
qs/qsagent.o qs/hdr_qs.o \
apps/app.o apps/telnet.o tcp/tcplib-telnet.o \
tools/trafgen.o trace/traffictrace.o tools/pareto.o \
tools/expoo.o tools/cbr_traffic.o \
adc/tbf.o adc/resv.o adc/sa.o tcp/saack.o \
tools/measuremod.o adc/estimator.o adc/adc.o adc/ms-adc.o \
adc/timewindow-est.o adc/acto-adc.o \
adc/pointsample-est.o adc/salink.o adc/actp-adc.o \
adc/hb-adc.o adc/expavg-est.o\
adc/param-adc.o adc/null-estimator.o \
adc/adaptive-receiver.o apps/vatrcvr.o adc/consrcvr.o \
common/agent.o common/message.o apps/udp.o \
common/session-rtp.o apps/rtp.o tcp/rtcp.o \
common/ivs.o \
common/messpass.o common/tp.o common/tpm.o apps/worm.o \
tcp/tcp.o tcp/tcp-sink.o tcp/tcp-reno.o \
tcp/tcp-newreno.o \
tcp/tcp-vegas.o tcp/tcp-rbp.o tcp/tcp-full.o tcp/rq.o \
baytcp/tcp-full-bay.o baytcp/ftpc.o baytcp/ftps.o \
tcp/scoreboard.o tcp/scoreboard-rq.o tcp/tcp-sack1.o tcp/tcp-fack.o \
tcp/tcp-asym.o tcp/tcp-asym-sink.o tcp/tcp-fs.o \
tcp/tcp-asym-fs.o \
tcp/tcp-int.o tcp/chost.o tcp/tcp-session.o \
tcp/nilist.o \
sctp/sctp.o apps/sctp_app1.o\
sctp/sctp-timestamp.o sctp/sctp-hbAfterRto.o \
sctp/sctp-multipleFastRtx.o sctp/sctp-mfrHbAfterRto.o \
sctp/sctp-mfrTimestamp.o \
sctp/sctp-cmt.o \
sctp/sctpDebug.o \
tools/integrator.o tools/queue-monitor.o \
tools/flowmon.o tools/loss-monitor.o \
queue/queue.o queue/drop-tail.o \
adc/simple-intserv-sched.o queue/red.o \
queue/semantic-packetqueue.o queue/semantic-red.o \
tcp/ack-recons.o \
queue/sfq.o queue/fq.o queue/drr.o queue/srr.o queue/cbq.o \
queue/jobs.o queue/marker.o queue/demarker.o \
link/hackloss.o queue/errmodel.o queue/fec.o\
link/delay.o tcp/snoop.o \
gaf/gaf.o \
link/dynalink.o routing/rtProtoDV.o common/net-interface.o \
mcast/ctrMcast.o mcast/mcast_ctrl.o mcast/srm.o \
common/sessionhelper.o queue/delaymodel.o \
mcast/srm-ssm.o mcast/srm-topo.o \
routing/alloc-address.o routing/address.o \
$(LIB_DIR)int.Vec.o $(LIB_DIR)int.RVec.o \
$(LIB_DIR)dmalloc_support.o \
webcache/http.o webcache/tcp-simple.o webcache/pagepool.o \
webcache/inval-agent.o webcache/tcpapp.o webcache/http-aux.o \
webcache/mcache.o webcache/webtraf.o \
webcache/webserver.o \
webcache/logweb.o \
empweb/empweb.o \
empweb/empftp.o \
realaudio/realaudio.o \
mac/lanRouter.o classifier/filter.o \
common/pkt-counter.o \
common/Decapsulator.o common/Encapsulator.o \
common/encap.o \
mac/channel.o mac/mac.o mac/ll.o mac/mac-802_11.o \
mac/mac-802_3.o mac/mac-tdma.o mac/smac.o \
mobile/mip.o mobile/mip-reg.o mobile/gridkeeper.o \
mobile/propagation.o mobile/tworayground.o \
mobile/antenna.o mobile/omni-antenna.o \
mobile/shadowing.o mobile/shadowing-vis.o mobile/dumb-agent.o \
common/bi-connector.o common/node.o \
common/mobilenode.o \
mac/arp.o mobile/god.o mobile/dem.o \
mobile/topography.o mobile/modulation.o \
queue/priqueue.o queue/dsr-priqueue.o \
mac/phy.o mac/wired-phy.o mac/wireless-phy.o \
mac/mac-timers.o trace/cmu-trace.o mac/varp.o \
mac/mac-simple.o \
satellite/sat-hdlc.o \
dsdv/dsdv.o dsdv/rtable.o queue/rtqueue.o \
routing/rttable.o \
imep/imep.o imep/dest_queue.o imep/imep_api.o \
imep/imep_rt.o imep/rxmit_queue.o imep/imep_timers.o \
imep/imep_util.o imep/imep_io.o \
tora/tora.o tora/tora_api.o tora/tora_dest.o \
tora/tora_io.o tora/tora_logs.o tora/tora_neighbor.o \
dsr/dsragent.o dsr/hdr_sr.o dsr/mobicache.o dsr/path.o \
dsr/requesttable.o dsr/routecache.o dsr/add_sr.o \
dsr/dsr_proto.o dsr/flowstruct.o dsr/linkcache.o \
dsr/simplecache.o dsr/sr_forwarder.o \
aodv/aodv_logs.o aodv/aodv.o \
aodv/aodv_rtable.o aodv/aodv_rqueue.o \
common/ns-process.o \
satellite/satgeometry.o satellite/sathandoff.o \
satellite/satlink.o satellite/satnode.o \
satellite/satposition.o satellite/satroute.o \
satellite/sattrace.o \
rap/raplist.o rap/rap.o rap/media-app.o rap/utilities.o \
common/fsm.o tcp/tcp-abs.o \
diffusion/diffusion.o diffusion/diff_rate.o diffusion/diff_prob.o \
diffusion/diff_sink.o diffusion/flooding.o diffusion/omni_mcast.o \
diffusion/hash_table.o diffusion/routing_table.o diffusion/iflist.o \
tcp/tfrc.o tcp/tfrc-sink.o mobile/energy-model.o apps/ping.o tcp/tcp-rfc793edu.o \
queue/rio.o queue/semantic-rio.o tcp/tcp-sack-rh.o tcp/scoreboard-rh.o \
plm/loss-monitor-plm.o plm/cbr-traffic-PP.o \
linkstate/hdr-ls.o \
mpls/classifier-addr-mpls.o mpls/ldp.o mpls/mpls-module.o \
routing/rtmodule.o classifier/classifier-hier.o \
routing/addr-params.o \
nix/hdr_nv.o nix/classifier-nix.o \
nix/nixnode.o \
routealgo/rnode.o \
routealgo/bfs.o \
routealgo/rbitmap.o \
routealgo/rlookup.o \
routealgo/routealgo.o \
nix/nixvec.o \
nix/nixroute.o \
diffserv/dsred.o diffserv/dsredq.o \
diffserv/dsEdge.o diffserv/dsCore.o \
diffserv/dsPolicy.o diffserv/ew.o diffserv/dewp.o \
queue/red-pd.o queue/pi.o queue/vq.o queue/rem.o \
queue/gk.o \
pushback/rate-limit.o pushback/rate-limit-strategy.o \
pushback/ident-tree.o pushback/agg-spec.o \
pushback/logging-data-struct.o \
pushback/rate-estimator.o \
pushback/pushback-queue.o pushback/pushback.o \
common/parentnode.o trace/basetrace.o \
common/simulator.o asim/asim.o \
common/scheduler-map.o common/splay-scheduler.o \
linkstate/ls.o linkstate/rtProtoLS.o \
pgm/classifier-pgm.o pgm/pgm-agent.o pgm/pgm-sender.o \
pgm/pgm-receiver.o mcast/rcvbuf.o \
mcast/classifier-lms.o mcast/lms-agent.o mcast/lms-receiver.o \
mcast/lms-sender.o \
queue/delayer.o \
xcp/xcpq.o xcp/xcp.o xcp/xcp-end-sys.o \
wpan/p802_15_4csmaca.o wpan/p802_15_4fail.o \
wpan/p802_15_4hlist.o wpan/p802_15_4mac.o \
wpan/p802_15_4nam.o wpan/p802_15_4phy.o \
wpan/p802_15_4sscs.o wpan/p802_15_4timer.o \
wpan/p802_15_4trace.o wpan/p802_15_4transac.o \
maser/maser.o maser/mamas.o \
$(OBJ_STL)
$(LINK) $(LDFLAGS) $(LDOUT)$# \
common/tclAppInit.o $(OBJ) $(LIB)
I figured out that the functions were declared but not implemented. As soon as I implemented them, the problem was solved.