//======================>>> makefileMaker::setDefaults <<============================
  void makefileMaker::setDefaults()
  {
    //erase previous definitions
    eraseAll();

    // init each one
    strcpy(makeName,"Makefile.v");
    vOS vos;
#ifdef V_VersionX
    if (vos.vGetEnvVal("HOMEV",homeV,fieldLen) < 1)
	strcpy(homeV,"$(HOME)/v");
    strcpy(exeName,"");
    strcpy(ctags,"*");
    strcpy(Libs, "-lV");
#else
    if (vos.vGetEnvVal("HOMEV",homeV,fieldLen) < 1)
	strcpy(homeV,"C:/v");
    strcpy(exeName,"");
    strcpy(ctags,"*");
    strcpy(Libs, "-lV -lcomctl32 -mwindows");
#endif
    strcpy(cc,"g++");
    strcpy(cFlags,"-O");
    strcpy(ObjDir,".");
    strcpy(BinDir,".");
    strcpy(SrcDir,".");
//    libDirs.insert(-1,"$(HOMEV)/lib");	// handled by wizard now
//    incDirs.insert(-1,"$(HOMEV)/include");
    changed = false;		// not changed yet
  }
コード例 #2
0
ファイル: easyprog.c プロジェクト: BackupTheBerlios/easyflash
/**
 * Ask the user if it is okay to erase all and do so if yes.
 */
static void checkEraseAll(void)
{
    if (screenAskEraseDialog() == BUTTON_ENTER)
    {
        checkFlashType();
        eraseAll();

        // remove the name, it's not valid anymore
        g_strFileName[0] = '\0';
        internalCartType = INTERNAL_CART_TYPE_NONE;
    }
}
//======================>>> makefileMaker::loadProject <<<============================
  void makefileMaker::loadProject (char *n)
  {
    //loads infos contained in project file n into makefileMaker member vars

    ifstream prjf(n);
    if (!prjf)
	return;

    eraseAll();
  

    // Project Options
    if (!getSectionList(prjf, SecProjOpts, SecProjOptsEnd, projOpts))
	return;

    // extract options to useful fields
    int optlim = projOpts.size();
    for (int ixa = 0 ; ixa < optlim ; ++ixa)
      {
	if (strstr(projOpts.list[ixa],"ctags:")!= 0)
	  {
	    strcpy(ctags,&projOpts.list[ixa][6]);
	  }
      }
    projOpts.erase();		// now erase all options to avoid dups

    // Makefile
    if (!getSectionEntry(prjf, SecMakefile, makeName))
	return;

    //0) options
    if (!getSectionList(prjf, SecOptions, SecOptionsEnd, curOpts))
	return;

    // HOMEV
    if (!getSectionEntry(prjf, SecHomeV, homeV))
	return;

    //1) exe name
    if (!getSectionEntry(prjf, SecTarget, exeName))
	return;

    //2) objs
    if (!getSectionList(prjf, SecObjFiles, SecObjFilesEnd, objFiles))
	return;

    //3) compiler name
    if (!getSectionEntry(prjf, SecCompiler, cc))
	return;

    //4) include dirs
    if (!getSectionList(prjf, SecIncDirs, SecIncDirsEnd, incDirs))
	return;

    //5) lib dirs
    if (!getSectionList(prjf, SecLibDirs, SecLibDirsEnd, libDirs))
	return;

    //6) defs
    if (!getSectionList(prjf, SecDefs, SecDefsPoolEnd, defsPool))
	return;
    if (!getSectionList(prjf, "", SecDefsEnd, curDefs))
	return;

    //7) cflag
    if (!getSectionEntry(prjf, SecCFlags, cFlags))
	return;

    //8) libflag 
    if (!getSectionEntry(prjf, SecLibFlags, Libs))
	return;

    //  SRC directory
    if (!getSectionEntry(prjf, SecSrcDir, SrcDir))
	return;

    // 9) object directory
    if (!getSectionEntry(prjf, SecObjDir, ObjDir))
	return;

    //10) bin directory
    if (!getSectionEntry(prjf, SecBinDir, BinDir))
	return;

    // User targets.
    if (!getSectionList(prjf, SecUserTargets, SecUserTargetsEnd, userTargets))
	return;

  }