Makefile question? [SOLVED]

7 posts / 0 new
Last post
marko
marko's picture
Offline
Last seen: 8 years 6 months ago
Joined: 2010-11-30 15:48
Makefile question? [SOLVED]

Hi, I have a problem with my makefile... the thing is that I have this script which works from shell without problem:

  1. cd DISTR
  2. LHA -aer a "Archive" "ProgDir"
  3. cd /

But I want to do this stuff in my makefile, so I've added "; \" so it will continue in the the same shell. And my makefile looks like this:

  1. //snip//
  2. lha :
  3. cd DISTR; \
  4. LHA -aer a "Archive" "ProgDir"; \
  5. cd /
  6.  
  7. //snip//

But it won't work? My script however and makefile works fine except this part, what am I doing wrong, any ideas? GNU Make 3.81 on OS4.1u2.

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
You need something

You need something like:

----------------

  1. DISTR := Disk:distribution
  2.  
  3. lha:
  4. <tab>@cd $(DISTR)
  5. <tab>@lha -aer a "Archive" "ProgDir"
  6. <tab>@cd /

----------------

Simon

marko
marko's picture
Offline
Last seen: 8 years 6 months ago
Joined: 2010-11-30 15:48
Thanks for the answer :) I

Thanks for the answer :)
I tried it and various forms of it but I did not get it to work :/

For, example:

  1. DISTR := "ram:"
  2.  
  3. lha:
  4. @dir $(DISTR)
  5. @cd $(DISTR)
  6. @dir

Does not work as I expected, the first dir [4] shows ram: but the second dir shows my current dir, I would like to stay in the directory given by [5] so the next dir [6] shows ram: as well. Other ideas?

__________________
m4rko.com/AMIGA

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
No, sorry. My makefile skills

No, sorry. My makefile skills are not that great. I tried it here with the same results as you.

Simon

marko
marko's picture
Offline
Last seen: 8 years 6 months ago
Joined: 2010-11-30 15:48
Thanks anyway, after further

Thanks anyway, after further doc reading I found the solution :-)

Ending the line with "@@\" will continue the shell execution, like:

  1. DISTR := "ram:"
  2.  
  3. lha:
  4. dir $(DISTR)
  5. cd $(DISTR)@@\
  6. dir

__________________
m4rko.com/AMIGA

salass00
salass00's picture
Offline
Last seen: 1 year 2 months ago
Joined: 2011-02-03 11:27
Another method that doesn't

Another method that doesn't involve using cd command would be to put a Makefile in $(DISTR) with the lha command and then put something like "make -C $(DISTR) lha" command in your main Makefile.

marko
marko's picture
Offline
Last seen: 8 years 6 months ago
Joined: 2010-11-30 15:48
@salass00 Thanks, good to

@salass00

Thanks, good to know :)

__________________
m4rko.com/AMIGA

Log in or register to post comments