On Mon, Jun 11, 2012 at 3:21 PM, Antonio Scuri <[email protected]> wrote:
>  The Bourne shell is not necessary. I run it here without one. Maybe is
> something related to the path. Let me check and I'll return to you.

It's not strictly necessary if the build directories already exist and
NO_DEPEND is defined, because then problematic constructs are not
used.

Anywhere echo is called, single quotes are used. In cmd.exe, echo
doesn't unquote its argument so this

        @echo ''; echo 'Tecmake: System Info'

actually does what this

    @echo "''; echo 'Tecmake: System Info'"

would do in Bourne shell. That incompatibility is harmless, but the
ones in directory and dependency creation are not.

        if [ ! -d $@ ] ; then mkdir -p $@ ; fi

Should be (requires Command Extension, enabled by default)

        if NOT EXIST $@ mkdir $(subst /,\,$@)
or
    if NOT EXIST $@ $(MKDIR) -p $@

where MKDIR holds the path to mkdir.exe. The depend target is pretty
tricky, the following seems to work (requires installing which):

        @echo. > $(DEPEND)
        @which gcc >NUL 2>&1 &\
        if ERRORLEVEL 1 (\
            echo. &\
            echo Tecmake: error, gcc not found. Dependencies can not be built.&\
            echo Must set NO_DEPEND=Yes &\
            echo. &\
            exit 1 )\
        else (\
            echo Tecmake: Building Dependencies ... [can be slow] &\
            gcc $(DEPINCS) $(DEFINES) $(STDDEFS) $(DEPDEFS) -MM $(SOURCES) | \
            sed -e "1,$$s/^\([^ ]*\)\.o/$$(OBJDIR)\/\1.$(OBJEXT)/" > $(DEPEND) 
&\
            echo. >nul )

I had to switch around the if and else branches. Also, I noticed you
check for gcc but use g++, that doesn't make sense to me so I used
gcc. It would be more efficient to make the depencies during
compilation, as described in http://mad-scientist.net/make/autodep.html.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to