all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wojtek Kosior via <help-guix@gnu.org>
To: Peter Polidoro <peter@polidoro.io>
Cc: zimoun <zimon.toutoune@gmail.com>, "(" <paren@disroot.org>,
	help-guix@gnu.org
Subject: Re: Using Makefile to run guix shell?
Date: Thu, 8 Dec 2022 16:30:08 +0100	[thread overview]
Message-ID: <20221208163008.51bc7692.koszko@koszko.org> (raw)
In-Reply-To: <87a63ydk95.fsf@polidoro.io>

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

> I do not know enough about writing Makefiles, but is there a way 
> to chain together the rules and targets so you could either use 
> Guix or not, like a "make serial-shell" and a "make 
> guix-serial-shell" with the latter prepending "guix 
> time-machine..." to the serial-shell command?

How about sth like

#+begin_src makefile
something:
	@ echo "Doing something"

guix-something:
	guix shell coreutils -- $(MAKE) something

.PHONY: something guix-something
#+end_src

Assuming you did put the above under /tmp you can try it out like this

#+begin_example
/tmp$ make something
Doing something
/tmp$ make guix-something 
guix shell coreutils -- make something
make[1]: Entering directory '/tmp'
Doing something
make[1]: Leaving directory '/tmp'
#+end_example

This is great for phony targets (i.e. ones that are not intended to
produce a file with the same name as the target). You're also not
forbidden from making `guix-` variants for non-phony targets the same
way. Although then the `guix-` variant will end up being phony anyway
¯\_(ツ)_/¯

W

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #37: blessed Michał Tomaszek
Poznaj świętych krakowskich!  #37: błogosławiony Michał Tomaszek
https://pl.wikipedia.org/wiki/Michał_Tomaszek
-- (sig_end)


On Thu, 08 Dec 2022 09:21:42 -0500
Peter Polidoro <peter@polidoro.io> wrote:

> zimoun <zimon.toutoune@gmail.com> writes:
> 
> > where I try to decouple what requires Guix and what not.  Well, 
> > I have
> > not tried, but the idea is then to run:
> >
> >     $ guix-serial-shell.sh make serial-shell
> >
> > where the Makefile contains the rule:
> >
> >     serial-shell:
> >        picocom -b 9600 -f n -y n -d 8 -p 1 -c $(PORT)  
> 
> I really like your approach and your directory layout, thank you.
> 
> So you are not concerned about Makefile conflicts or using Make in 
> ways that may not have been intended? Maybe I should just learn to 
> stop worrying and love the Makefile.
> 
> It does seem to add lots of complication in order to decouple Guix 
> from the Makefile, though, with all the extra shell scripts and 
> commands. In general I like the idea of software units being 
> decoupled, but realistically I never want to go back to life 
> before Guix. Spending too much effort making it work without Guix 
> just encourages other people to use bad practices I am starting to 
> think.
> 
> I do not know enough about writing Makefiles, but is there a way 
> to chain together the rules and targets so you could either use 
> Guix or not, like a "make serial-shell" and a "make 
> guix-serial-shell" with the latter prepending "guix 
> time-machine..." to the serial-shell command?
> 



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

  reply	other threads:[~2022-12-08 15:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 14:47 Using Makefile to run guix shell? Peter Polidoro
2022-12-07 15:12 ` (
2022-12-07 15:26   ` Peter Polidoro
2022-12-07 15:38     ` (
2022-12-07 18:27       ` Peter Polidoro
2022-12-07 21:01         ` Wojtek Kosior via
2022-12-08 10:44         ` zimoun
2022-12-08 14:21           ` Peter Polidoro
2022-12-08 15:30             ` Wojtek Kosior via [this message]
2022-12-08 18:47             ` zimoun
2022-12-08 21:30               ` Wojtek Kosior via
2022-12-08 23:04                 ` zimoun
2022-12-08 23:24                   ` Wojtek Kosior via
2022-12-09 17:46                   ` Peter Polidoro
2022-12-10 13:21                     ` zimoun
2022-12-12 17:55                       ` Peter Polidoro
2022-12-12 19:00                         ` Wojtek Kosior via
2022-12-09 18:38     ` Philip McGrath
2022-12-07 17:08 ` Wolf

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=20221208163008.51bc7692.koszko@koszko.org \
    --to=help-guix@gnu.org \
    --cc=koszko@koszko.org \
    --cc=paren@disroot.org \
    --cc=peter@polidoro.io \
    --cc=zimon.toutoune@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.