Show
Ignore:
Timestamp:
08/11/08 12:35:29 (5 months ago)
Author:
liamstask
Message:

- update Makefile generation to include a dependency on config.h so projects can be rebuilt more intelligently. Also, be sure to modify config.h if it's different from the current ProjectInfo?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mcbuilder/trunk/src/Builder.cpp

    r806 r807  
    4040  connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(nextStep(int, QProcess::ExitStatus))); 
    4141  connect(this, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onBuildError(QProcess::ProcessError))); 
    42    
    43   cleanFirst = false; 
    44   buildPending = false; 
    4542} 
    4643 
     
    5047void Builder::build(QString projectName) 
    5148{ 
    52   if(cleanFirst) 
    53   { 
    54     cleanFirst = false; 
    55     buildPending = true; 
    56     return clean(projectName); 
    57   } 
    5849  currentProjectPath = projectName; 
    5950  QDir dir(currentProjectPath); 
    6051  setWorkingDirectory(dir.filePath("build")); 
    6152  loadDependencies(LIBRARIES_DIR, currentProjectPath);      // this loads up the list of libraries this project depends on 
     53  if(compareConfigFile(currentProjectPath)) 
     54  { 
     55    createConfigFile(currentProjectPath);      // create a config file based on the Properties for this project 
     56    qDebug("creating/updating config file"); 
     57  } 
    6258  createMakefile(currentProjectPath);        // create a Makefile for this project, given the dependencies 
    63   createConfigFile(currentProjectPath);      // create a config file based on the Properties for this project 
    6459  buildStep = BUILD; 
    6560  currentProcess = "make"; 
     
    9893} 
    9994 
    100 void Builder::onProjectUpdated() 
    101 { 
    102   cleanFirst = true; 
    103 } 
    104  
    10595void Builder::stop() 
    10696{ 
     
    161151    case CLEAN: 
    162152      mainWindow->onCleanComplete(); 
    163       if(buildPending) 
    164       { 
    165         buildPending = false; 
    166         build(currentProjectPath); 
    167       } 
    168153      break; 
    169154  } 
     
    321306          tofile << "\t" << "$(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)" << endl << endl; 
    322307 
    323           tofile << "$(THUMB_OBJ) : %.o : %.c" << endl; 
     308          tofile << "$(THUMB_OBJ) : %.o : %.c ../config.h" << endl; 
    324309          tofile << "\t" << "$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@" << endl << endl; 
    325310 
    326           tofile << "$(ARM_OBJ) : %.o : %.c" << endl; 
     311          tofile << "$(ARM_OBJ) : %.o : %.c ../config.h" << endl; 
    327312          tofile << "\t" << "$(CC) -c $(CFLAGS) $< -o $@" << endl << endl; 
    328313