Re: [AD] make install DEBUGMODE=1 failure

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


We should really have a way to solve this for all systems. For Unix systems, Sam's solution will work, but it won't work on Windows. The problem is that failing to create the directory because it already exists shouldn't break the buildprocess.


FYI, in Windows/DOS you could do:
if not exist $(DIR) mkdir $(DIR)
That way, mkdir will only run if $(DIR) doesn't exist. Although, AFAIK there's no way to tell if it's a file or directory that way.



i could write a very simple app that could return true/false if the folder exists.
could it be called from a makefile ?

yes


/* win32 does folder exist */
#include <io.h>
int main(int argc, int argv[] )
{
   struct _finddata_t f;
   int handle = _findfirst( argv[1], &f );
   int result = 0;
   if ( -1 != handle )
   {
      if ( f.attrib & _A_SUBDIR )
         result = 1;
   }
   _findclose();
   return result;
}





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/