From: yap m. <so...@ya...> - 2011-03-28 17:08:10
|
Yes. I agree. We do use bash or sh as the SHELL for our makefiles. And we do have the frequently use utility tools defined as variables and use them to invoke the programs. Actually, we have quite a few makefiles for different tools and plenty of scripts that share between Linux and Windows. So, it would be great if I can keep the command consistent. I can actually add an if-else case in a few global makefiles for the pwd difference. Thanks a lot for all the helps. ________________________________ From: Earnie <ea...@us...> To: MinGW Users List <min...@li...> Sent: Mon, March 28, 2011 9:27:44 PM Subject: Re: [Mingw-users] MSYS Command Hangs when run with Condor Greg Chicares wrote: > On 2011-03-28 09:27Z, yap munsoon wrote: >> Is there a way to make "pwd -W" as >> default when calling pwd within sh.exe? > > If you aren't changing the directory after 'make' starts, then you can > just use the predefined variable $(CURDIR). This makefile works with > both MSYS and CMD.EXE: > ... > > In general, it's a good practice to define a 'make' variable for each > utility program, and then always use the variable to invoke the > program. For example: > RM := /bin/rm > $(RM) file-to-be-removed > Because it's defined in only one place, you can override the behavior > globally--e.g., to use '/usr/local/bin/customized_rm' instead. If you > always want the '-W' flag, define $(PWD) to be 'pwd -W' when you're > using MSYS, and write $(PWD) instead of invoking 'pwd' directly; then > you don't have to worry about accidentally omitting '-W' somewhere, > and your makefile will be more portable. Altering the behavior of your > MSYS installation is possible, but not a very good idea because then > your makefile won't work correctly on a default MSYS installation. > You can also create an alias (``help alias'' from the bash shell) such as ``alias pwd='pwd -W''' but the side effect is there is no opposite for the switch and you will never see the POSIX path. The alias can be added to your ~/.profile file which is read by bash on start up to initialize the environment. But regarding what Greg has given, it will be best to use a variable in the Makefile so that it always works. -- Earnie -- http://www.for-my-kids.com ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ MinGW-users mailing list Min...@li... This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-users Also: mailto:min...@li...?subject=unsubscribe |