Author Topic: invoke "Generate makefile" via command line  (Read 17530 times)

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: invoke "Generate makefile" via command line
« Reply #15 on: February 14, 2007, 02:33:59 pm »
vusrmacs.e should be in you SE 'config' dir.
If it's not there (you really didn't record a macro or wrote some cool extensions .. how did you survive ;) ?)

Put the attached exampe into your $HOME -> slick config dir and 'Macro->Load Module ..'
This should solve 1)
Concerning deployment procedure I think the SlickTeam can give a hint.

HS2

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2440
  • Hero Points: 137
Re: invoke "Generate makefile" via command line
« Reply #16 on: February 14, 2007, 02:44:27 pm »
Ok... Let's try this.  Tweak the code as follows.  Create a file called "gmkf.e" anywhere you like.  (Everybody needs to have read permission to it).  Insert the following code:

Code: [Select]
#include 'slick.sh'

defmain()
{
   _str cmdline=arg(1);
   _str projectName=parse_file(cmdline);
   _str makefileName=parse_file(cmdline);

   if ( !file_exists(projectName) ) {
      _message_box(nls("File '%s' not found",projectName));
      return FILE_NOT_FOUND_RC;
   }
   int status=generate_makefile(projectName,makefileName);
   return status;
}

Then to run it use:

Code: [Select]
<pathToVs>vs -p <pathToMacro>gkmf.e <projectfilename> <makefilename>

Ultimately, I would wrap the running of it (second example) in a shell script, but I will leave that to you (or maybe hs2 ;)) as this is not really a strength of mine.

I based this on the code I wrote, although you might want to merge in the extras that hs2 included.  Dependencies are stored in the .vpj file, so I am not sure that they workspace file needs to be open (also this could get saved in the auto restore file).

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: invoke "Generate makefile" via command line
« Reply #17 on: February 14, 2007, 02:58:23 pm »
Oh yes - Slick-C batch files ... thanks for bringing it back to my mind Dan.
This is definitely the way to go for enterprise Slick maintenance and is surely interesting for some other users.
Maybe it's even worth to add some sentences about that to the HowTo section of Lisa's great new documentation...

HS2

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2440
  • Hero Points: 137
Re: invoke "Generate makefile" via command line
« Reply #18 on: February 14, 2007, 03:06:11 pm »
Actually if you run "help defmain" on the SlickEdit command line the section "DEFMAIN: Writing Slick-C Batch Files" does a pretty good job of explaining this. 

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: invoke "Generate makefile" via command line
« Reply #19 on: February 14, 2007, 03:14:12 pm »
Right - but I mean the 'How to maintain an enterprise Slick installation'.
There were already some related questions here and no good answers until now.
And e.g. distributing '<stuff>.e' files per eMail is maybe not an option ;)

HS2

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Re: invoke "Generate makefile" via command line
« Reply #20 on: February 14, 2007, 03:16:36 pm »
wicked boys...  am going to try this out... and will report back

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Re: invoke "Generate makefile" via command line
« Reply #21 on: February 14, 2007, 03:27:42 pm »
Dan, you said dependencies are stored in the vpj file... I looked at an older vpj I had (before I swtiched to auto gen'd makefiles) and I dont see anything in there that would create a link between main.cpp and x.h and y.h.

Does the slick edit vpj auto dependency checker create all of these links, or is it kind of dumb and only link main.cpp with a main.h (ie matching file names).

It is becomign absolutley crucial that all our dependencies get check at each build, because the project is getting huge and compile time are getting brutally slow.

I tried to go with make and makedepend... but this is crap.  so now I am back to using a vpj for dependencies.  I want to be sure the slick auto dependecy checking covers all dependencies on a source file.

Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 23
  • User-friendly geek-speak translator extraordinaire
Re: invoke "Generate makefile" via command line
« Reply #22 on: February 14, 2007, 04:42:08 pm »
Right - but I mean the 'How to maintain an enterprise Slick installation'.
There were already some related questions here and no good answers until now.
And e.g. distributing '<stuff>.e' files per eMail is maybe not an option ;)

HS2

Thanks for the suggestion, HS2 - I've added this to my tracking system as a "doc feature request."

-Lisa

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Re: invoke "Generate makefile" via command line
« Reply #23 on: February 14, 2007, 06:40:58 pm »
success!
thanks a WHOLE BUNCH to hs2 and Dan.

this forum rocks