Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: How to move from make files to Genero Studio  (Read 23251 times)
Nuno G.
Posts: 38


« on: February 18, 2014, 11:46:55 am »

I have a problem trying to migrate our apps from the old "make -f Makefile" to Genero Studio.
The thing is our Makefiles are quite complex, checking dependecies on their own, compling and linking the files and libraries required for every module and so on.
Therefore I've been looking for a way to use them to compile our sources instead of, e.g.,  creating duplicate library nodes for every single module (that is 42r file) I've on our app. Furthermore I would like to break our app project into several small projects, in order to reduce (I hope) the load on our local machines.
Did somenone went over the same kind of problems. If so what did you do it ?
Any help our suggestions will be quite welcomed.
TIA
Nuno
Reuben B.
Four Js
Posts: 1116


« Reply #1 on: February 19, 2014, 12:10:25 am »

Hi Nuno,

I'll throw some functionality at you, and you may be able to use one or some parts in a solution

1. Look at Preferences->General->User Actions.  You can create a user action to execute the make.  You can then either add this to Toolbar/TopMenus/Accelerators via Preferences->User Interface->*.  You can also make it right-clickable on files with certain extension e.g. mak via Tools->Global Setup->Edit File Associations.  So you can end up by having a .mak file inside your .4pw that you can then do a make via a right-click on this file

2.  In project workspace, right-click on a group, and select Add External Project.  That enables you to define smaller .4pw's, that you can then link to your project.  So rather than having one big .4pw, you can have one .4pw for each application, and library(s).  You can then also have a group.4pw (e.g. Sales, Purchasing, GL etc) that you then add every program in that group as an external project, and at the extreme have an all.4pw that has every program as an external project.  Your senior developer can then rebuild everything via all.4pw, or you use gsmake in your overnight scripts with this project if you do overnight smoke tests etc.

3. Right-click on an application or project node and select Edit Build Rules.  Edit/Duplicate etc to cater for your particular needs.

Hope that helps,

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Nuno G.
Posts: 38


« Reply #2 on: February 19, 2014, 10:33:42 am »

Thank you very much Reuben. I'll take a good look into it and see how it turns on.
Best regards
Nuno
Nuno G.
Posts: 38


« Reply #3 on: February 19, 2014, 11:30:36 am »

I must be doing sometjing wrong!

I'm using gst 2.41 and a remote server. The server is Linux

uname -a
Linux averell 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:33:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux


I have Cygwin installed on my PC
Source path is shared through Samba and mapped as T: drive onn my local machine

My user action goes like this

../make.sh

The file is there and I can execute it nicely through the unix shell


The contents of make.sh goes like this.

cd $SRC
make -f Makefile

SRC is defined and it is correct.

However when I try to executed it and get the following output

*** Action 'MakeItAll' started ***
make.sh stderr> ::error:(GS-1004) Process failed to start. Check executable files existance and permissions.
Command line: '../make.sh'
The program make.sh exited with status 0
*** Action 'MakeItAll' failed ***


three remarks:
a) I used similar shell scripts on the postLink of the test modules (that is 42r programs) and they worked just fine!
b) file make.sh has now 777 chmod attributes
c) the inclusion of a pwd instruction in the user action confirms the relative path of the shell script

Surely i'm doing something wrong, most probabily due my lack of experience with GST (right now we still use the old and good shell programming and execution)

Sorry for the inconvenience and many thanks for all your help.




Reuben B.
Four Js
Posts: 1116


« Reply #4 on: February 19, 2014, 11:42:10 pm »

The key thing with Studio (and GAS for that matter as well) is to remember that it still has to follow the rules of the OS.  So when you press compile/build, start a user action etc in Studio (or launch program in GAS), deep down it is setting an environment, navigating to a directory, and executing a command, just the same as if you had typed it in at the command prompt.  So in your analysis you did ...

Quote
the inclusion of a pwd instruction in the user action confirms the relative path of the shell script

... what you should also do is check the environment.  So in the same way you did a pwd, try something like a env > /tmp/tmp.env

Also as you are using a Remote config, the user action is executing on the local machine.  One POC I did used plink.exe and a lot of stuff after it in order to execute the command I wanted on the remote machine.

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Reuben B.
Four Js
Posts: 1116


« Reply #5 on: February 20, 2014, 05:31:24 am »

Also try

sh ./make.sh

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Nuno G.
Posts: 38


« Reply #6 on: February 20, 2014, 02:46:12 pm »

Thanks Reuben. I'll have a go.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines