Find the answer to your Linux question:
Results 1 to 3 of 3
I have a target in a Makefile which uses some variables that are defined in a shell script. Can I call that script in the Makefile ?? I wonder if ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    59

    execute shell script from a Makefile

    I have a target in a Makefile which uses some variables that are defined in a shell script. Can I call that script in the Makefile ?? I wonder if I call a script with a shell then the variables will be available for that environment only.
    Is there any way to do that??
    I can't source that file before calling make for some reason.

  2. #2
    Just Joined!
    Join Date
    Apr 2007
    Posts
    59

    source the script

    Basically, I want to source the script having those variables so that I can use those variables in my makefile.

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    1

    execute shell script from a Makefile

    You do it with a shell statement, e. g.
    Code:
    FILE_COUNT = $(shell ls | wc -l )
    See also:
    CM Crossroads
    Introduction to making Makefiles

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...