[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: help with d/rules: is it possible to use with dh_auto_build -- $$arg within a for loop ?



Christophe Trophime <christophe.trophime@lncmi.cnrs.fr> writes:

> I would like to simplify d/rules for a local package:
>
>
>
> override_dh_auto_build:
> for D in "Axi 3D"; do \
>
> for N in "1 2"; do \
> echo "building hifimagnet$$D_P$$N_N$$N" ; \
> dh_auto_build -- hifimagnet$$D_P$$N_N$$N ; \
> done ; \
> done
>
> it seems not working.

How is it not working? Can you post the error? I can imagine that
debhelper gets confused if you invoke dh_auto_build multiple times, but
I can't say for sure.

Oh, and you should use make to handle the loop, instead of using the
shell inside make. Then make can parallelize if you 'make -j', and
things will just work better. Below I'm also not invoking dh_auto_build
multiple times, so it might fix your issue too. Something like this:

  ALL_BUILD_TARGETS := $(foreach D,Axi 3D, $(foreach N,1 2,hifimagnet$D_P$N_N$N))
  override_dh_auto_build: $(ALL_BUILD_TARGETS)

If your debian/rules has rules for building hifimagnet$D_P$N_N$N then
you're done. Otherwise you need to tell it how to do that. If you're
punting to some other Makefile, tell it that:

  $(ALL_BUILD_TARGETS): hifimagnet%:
          $(MAKE) $@
  .PHONY: $(ALL_BUILD_TARGETS)


Reply to: