webdevRefinery Forum: make - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is online _Sam 

  • Beep Beep
  • Group: Members
  • Posts: 634
  • Joined: 11-March 10
  • LocationZurich, Switzerland
  • Expertise:HTML,CSS

Posted 06 July 2012 - 06:18 AM (#1)

make


How would I set it up on my Linux PC to have when I type "make" or "make all" but not when I type "make clean" to have me enter some text that will be written to a file before the actual make process starts? Would I put that in the .bashrc and how would that look like?
(ಠ_ಠ)
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 06 July 2012 - 06:42 AM (#2)

That'd probably be in the Makefile (or the configure script), not in the .bashrc. It'd differ per app depending on what make system the app uses.
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is online _Sam 

  • Beep Beep
  • Group: Members
  • Posts: 634
  • Joined: 11-March 10
  • LocationZurich, Switzerland
  • Expertise:HTML,CSS

Posted 06 July 2012 - 07:08 AM (#3)

Well there are 3 different repositories and I can't check that change in so it would be local and lost on the next update or checkout. So I'd prefer a solution that is only local and does not touch the code.
The version number is in a file and I prefer to set that version number before the make, but I tend to forget it so I want to be forced to put it in.
(ಠ_ಠ)
0


User is offline Quinn 

  • More pew-pew, less QQ
  • Group: Members
  • Posts: 1307
  • Joined: 08-March 10
  • LocationPalmyra, PA, USA
  • Expertise:HTML,PHP,Javascript

Posted 06 July 2012 - 09:36 AM (#4)

Well, you could do an alias.
alias make='{ADD VERSION NUMBER TO TEXT FILE} && make'


Edit: Don't take my word for it though, I'm not 100% sure that this would work.
<Imp> [F3ar 40]  [PWNbear 17]  [magik 15]  [dissident 10]  [mark 7]

View PostKyek, on 07 February 2011 - 07:11 AM, said:

Though anyone who thinks Europe is a country should be smacked in the face. By a train.
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1351
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 06 July 2012 - 11:16 AM (#5)

In your
.bashrc
:

make () {
    if [ "$1" != "clean" ]; then
        "$EDITOR" yourfile.txt
    fi

    "$(which make)" $@
}

1


User is offline lobabob 

  • Group: Members
  • Posts: 98
  • Joined: 21-March 10
  • LocationWouldn't you like to know?
  • Expertise:HTML,CSS

Posted 08 July 2012 - 01:27 AM (#6)

I think .bashrc gets overwritten with updates. I would put:
make () {
    if [ "$1" != "clean" ]; then
        "$EDITOR" yourfile.txt
    fi

    "$(which make)" $@
}
alias make=make


in .bash_aliases instead of .bashrc
"When the world goes mad, one must accept madness as sanity since sanity is, in the last analysis, nothing but the madness on which the whole world happens to agree." - George Bernard Shaw

Life = http://xkcd.com
0


User is offline Cyril 

  • Group: Members
  • Posts: 2544
  • Joined: 03-August 10
  • Expertise:HTML,CSS,PHP,Javascript,Graphics

Posted 08 July 2012 - 03:02 AM (#7)

.bash_profile anyone?

website :: github :: twitter :: dribbble :: forrst
html, css, php, javascript, graphics
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1351
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 08 July 2012 - 02:01 PM (#8)

View Postlobabob, on 08 July 2012 - 01:27 AM, said:

I think .bashrc gets overwritten with updates. I would put:
make () {
    if [ "$1" != "clean" ]; then
        "$EDITOR" yourfile.txt
    fi

    "$(which make)" $@
}
alias make=make


in .bash_aliases instead of .bashrc

No it doesn't!
/etc/bashrc
will be, but on any decent operating system the files in your hone directory are your own and won't be overwritten on a whim. The files in your hone directory generally source the global ones in
/etc
, then the user may specify their preferences afterwards, thus taking priority. I've never seen the users files modified, so I'd be sending a ranty email to your system administrator ;)

@Cyril
.bash_profile
is generally used to set up agent applications and such. I'd recommend using the RC (run time configuration file.
0


User is offline Quinn 

  • More pew-pew, less QQ
  • Group: Members
  • Posts: 1307
  • Joined: 08-March 10
  • LocationPalmyra, PA, USA
  • Expertise:HTML,PHP,Javascript

Posted 08 July 2012 - 02:25 PM (#9)

View PostRuku, on 08 July 2012 - 02:01 PM, said:

No it doesn't!
/etc/bashrc
will be, but on any decent operating system the files in your hone directory are your own and won't be overwritten on a whim. The files in your hone directory generally source the global ones in
/etc
, then the user may specify their preferences afterwards, thus taking priority. I've never seen the users files modified, so I'd be sending a ranty email to your system administrator ;)

I thought the first one was a simple typo, but two of them? I thought better of you D:
<Imp> [F3ar 40]  [PWNbear 17]  [magik 15]  [dissident 10]  [mark 7]

View PostKyek, on 07 February 2011 - 07:11 AM, said:

Though anyone who thinks Europe is a country should be smacked in the face. By a train.
0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 08 July 2012 - 02:58 PM (#10)

View PostQuinn, on 08 July 2012 - 02:25 PM, said:

I thought the first one was a simple typo, but two of them? I thought better of you D:

They renamed it a couple years back, home is a silly name >_<
Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1351
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 09 July 2012 - 02:00 AM (#11)

View PostQuinn, on 08 July 2012 - 02:25 PM, said:

I thought the first one was a simple typo, but two of them? I thought better of you D:

Auto complete in ICS sucks. I corrected it manually once but it seems to have corrected it back again!?
0


User is online _Sam 

  • Beep Beep
  • Group: Members
  • Posts: 634
  • Joined: 11-March 10
  • LocationZurich, Switzerland
  • Expertise:HTML,CSS

Posted 09 July 2012 - 04:18 AM (#12)

Thanks Ruku your answer helped me a lot.
This is what I finally came up with:
make () {
        if [ -f $1 ] ; then
                if [ $BUILD_ROOT ] ; then
                        if [[ $PWD = */int ]] ; then
                                vi $BUILD_ROOT/../releases/release.nbr
                        fi
                fi
        fi
        "$(which make)" $@
}

I now only do it when there is no argument and when it's called from a certain folder.
(ಠ_ಠ)
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services