The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Use GNU Make to build installer?

I am researching the possiblity of writing a make file to build Windows installer. The make should be instructed to build source file structures, copy file if needed and call Installshield build command line to build. I am now stuck on the first step - how to write make entries to set up source folders (with sub-directories). Any ideas thanks!
Saturday, August 27, 2005
Is GNU make a requirement? This sounds do-able with a batch file, or better with something like FinalBuilder.
Nate Silva Send private email
Saturday, August 27, 2005
Dont know if this will help but you can use mkdir with the -p option. This will create a directory and subdirectories.
For example:
mkdir -p ./dir1/dir2
will create dir1 and then the dir2 subdirectory.
Parisian developer ISO cute geek girl
Saturday, August 27, 2005
Make takes time to learn.

If it's not a requirement, consider SCons, which also takes time to learn, but is much better in almost every respect.

Also, avoid InstallShield if you can. A viable alternative for most projects is NSIS (which, btw, has support from SCons).
Ori Berger
Saturday, August 27, 2005

    mkdir -p $@


Note, that in the rule above I used 4 spaces and not a tab. Copying and pasting the above will not work because you need a literal tab, not 4 spaces.

So...  makefiles are lists of dependencies and rules to fullfilling the dependencies.

The above rule has no dependency - nothing on the right side of ':'. It will get made unconditionally.
hoser Send private email
Sunday, August 28, 2005
In Microsoft NMake you can use if exist in the command line, such as

  if not exist folder mkdir folder

but it does not work in GNU make.
Sunday, August 28, 2005
I'm using makefile for creating media images. I'm glad to share the knowledge if its of your use.

I'm creating the following directories for media image creation purpose .

1) Staging directory (from where your source will be picked)
2) Media directory (place to generate/copy media images)
3) Files directory (where you can put, project file, license to be picked up, images like splash screen etc)

Now before creating media images you must understand to make use of Path variables in InstallShield. I hope you understand their use, else get into the basics of designing installers. The complete Product structure should be defined using Path Variables in you installer project file. All the sources directories(say bin, samples etc) should be included with Path variables(eg $A(PRODUCT_STAGING)/samples where $(PRODUCT_STAGING) may be C:\myproduct). These runtime path are provided to the "InstallShieldUniversalCommandLineBuild.exe" using alias.

Let, you are first creating an IS project for your product in C:\ISU. Say..
c:\isu\staging    (path var name myProd_STAGING
c:\isu\media      (path var name myProd_FILES)
c:\isu\projfile  (path var name myProd_MEDIA)

Define few path variables say you defined a Path variable which points to c:\isu\staing.. similarlly for others also; Make it a point to include all the subdirectories of your product should follow the Path variable

Now in your makefile, you can define following targets..I'm assuming you are using some form of versioning tool like clearcase.

1. _create_staging - where you will create aforementioned dirs
2. _copy_install_image_to_staging  - copy your build( from clearcase view ) to staging area.
3. _copy_project_to_staging - copy project file etc(if checked in clearcase to the  projfile directory)
4. _update_project_file- Say you want to update the project file like inserting  Current Version Number through XSL, etc. Or you want to update the name of executable at build time.. for that you can use "sed" in Makefile to update project file.
5. _create_media - you can use a batch file or shell script in which you are writing the complete media creation variables etc. and you are calling this script in to the make file like
  build = "win32 solaris64"

  $ISUBuildCmd" "$projfile" \
                -alias myProd_STAGING="$STAGING" \
                -alias myProd_FILES="$FILES" \
                -alias myProd_MEDIA="$MEDIA" \
                -build $build

6. _copy_media- to copy media image to any other place say from where you copied the staging sources. By default it will be created in Media directory.
Gautam Send private email
Monday, August 29, 2005
Burner, Burnder, (same person?).

You don't need to ask if the file exists. The fact that it is running the rule _means that it does not exist_.

This is a makefile, not a shell script or batch file. You need to start thinking in terms of dependencies. Things will get done because they need to be done.

There are ways to check if something does not exist, but it is not the way you are supposed to be using a makefile:

    if [ -e $@ ] ; then \
        do_something; \

Unless there is something specific that for some reason make would not handle with normal dependencies, that example shold be avoided.
hoser Send private email
Monday, August 29, 2005
My statement _means that it does not exist_ should actually read "means that it is out of date", but for "existance" is the same thing.
hoser Send private email
Monday, August 29, 2005
Thank you for all the advices. Especially Gautam and hoser.

My idea is to use Make to create. Yes, the meanings for "non-existent' and "out-dated" are the same, as long as the intermediate folder exists. There is no problem i saw for Make to detect the file dependency and copy the file if needed. What I also wanted to achieve is to create an intermediate directory if that directory does not exist. When I have all the source file (in another location), I could just run the Make to build a installer without first seting up the directory and sub-directory.

Now I can place the directory in the target. mkdir will report an error when the directory to create already exists.

Does cp command has an option to create intermediate directory if it can not be found?
Monday, August 29, 2005
Use mkdir -p (assuming cygwin).

The -p options will not report an error if the directory exists.  Also, you can

mkdir -p /do/any/of/these/intermediate/dirs/exist

And it will create all the directories from /do down to /.../exist without error.

I think that is what you were really looking for?

Unfortunately, the command.exe parser/utility set is brain-dead, and there is no suck thing for DOS/Windows. Thus cygwin is an almost mandatory add-on.
hoser Send private email
Tuesday, August 30, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz