ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Vitaly Ostanin <vyt@vzljot.ru>
To: community@altlinux.ru
Subject: [Comm] Re: Makefile HELP!
Date: Mon, 24 Jan 2005 09:07:32 +0300
Message-ID: <41F490A4.3030406@vzljot.ru> (raw)
In-Reply-To: <20050121072314.GA10143@ldc.net>

[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]

Dmytro O. Redchuk пишет:
> Добрый  день.
> 
>    Вот возник вопрос -- не могу справиться.
> 
>    Скажите, можно ли (хочу надеяться, что "да") в Makefile понять,
>    выполнялась ли какая-то определённая цель?
> 
>    Например:
>     0  a_lot_of_files = foo moo bar
>     1
>     2  backup: $(a_lot_of_files)
>     3  ifeq($(MAKECMDGOALS),check)
>     4	   # да нет, никаких бэкапов, мы только проверяем...
>     5  esle
>     6      # пум-пурум, пам-парам...
>     7  endif
>     8
>     9  check: backup
>    10      # а выполнялся ли backup?!
>    11      # если ДА, то бэкаповых файлов НЕТ.
>    12      # если НЕТ, то всё ОК.
> 
> 
>    Пробовал где-то в строке 4 писать что-то типа define NO_BACKUP, но
>    потом запроблемилось его проверить где-то в строке 10 (как ни пробовал,
>    не получается:)
> 
>    Можно, конечно, играться с переменной $?, но в ней может быть слишком
>    много всего, а мне нужно проверить только одну цель, например.

Можно попробовать поиск вхождения этой цели в $?, ну и $^ может 
пригодиться.

В вашем случае можно указать зависимость бакапных файлов от 
исходных и не делать цели с циклическими зависимостями.

<skipped/>

-- 
Regards, Vyt
mailto:  vyt@vzljot.ru
JID:     vyt@vzljot.ru

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  reply	other threads:[~2005-01-24  6:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-21  7:23 [Comm] " Dmytro O. Redchuk
2005-01-24  6:07 ` Vitaly Ostanin [this message]
2005-01-24  8:55   ` [Comm] " Dmytro O. Redchuk
2005-01-24  9:06     ` Vitaly Ostanin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41F490A4.3030406@vzljot.ru \
    --to=vyt@vzljot.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git