Changeset 9956d77 in rtems-libbsd for freebsd-to-rtems.py


Ignore:
Timestamp:
Dec 12, 2013, 9:39:56 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, fd86c091b97759106da7355ce1dd81ebe030e285, freebsd-9.3, f020f08430150c1656a0ad0a1de13699db9b980b
Children:
c56c1db
Parents:
e48f6038
git-author:
Sebastian Huber <sebastian.huber@…> (12/12/13 09:39:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/16/13 14:34:46)
Message:

Allow source file set specific compiler flags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd-to-rtems.py

    re48f6038 r9956d77  
    310310
    311311class SourceFileMakefileFragmentComposer(MakefileFragmentComposer):
     312        def __init__(self, cflags = None):
     313                self.cflags = cflags
     314
    312315        def compose(self, path):
    313                 return 'LIB_C_FILES += ' + path + '\n'
     316                fragment = 'LIB_C_FILES += ' + path + '\n'
     317                if self.cflags != None:
     318                        fragment = fragment + path[:-1] + 'o: ' + path + '\n' \
     319                                + '\t$(CC) $(CPPFLAGS) $(CFLAGS) ' + self.cflags + ' -c $< -o $@\n'
     320                return fragment
    314321
    315322class TestMakefileFragementComposer(MakefileFragmentComposer):
     
    603610                        self.files = self.addFiles(self.files, files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU), FromFreeBSDToRTEMSHeaderConverter(), NoConverter(), assertHeaderFile)
    604611
    605         def addSourceFiles(self, files):
    606                 self.files = self.addFiles(self.files, files, PathComposer(), NoConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
    607 
    608         def addKernelSpaceSourceFiles(self, files):
    609                 self.files = self.addFiles(self.files, files, FreeBSDPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
    610 
    611         def addUserSpaceSourceFiles(self, files):
    612                 self.files = self.addFiles(self.files, files, FreeBSDPathComposer(), FromFreeBSDToRTEMSUserSpaceSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
    613 
    614         def addRTEMSSourceFiles(self, files):
    615                 self.files = self.addFiles(self.files, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
    616 
    617         def addCPUDependentSourceFiles(self, cpu, files):
     612        def addSourceFiles(self, files, cflags = None):
     613                self.files = self.addFiles(self.files, files, PathComposer(), NoConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
     614
     615        def addKernelSpaceSourceFiles(self, files, cflags = None):
     616                self.files = self.addFiles(self.files, files, FreeBSDPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
     617
     618        def addUserSpaceSourceFiles(self, files, cflags = None):
     619                self.files = self.addFiles(self.files, files, FreeBSDPathComposer(), FromFreeBSDToRTEMSUserSpaceSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
     620
     621        def addRTEMSSourceFiles(self, files, cflags = None):
     622                self.files = self.addFiles(self.files, files, RTEMSPathComposer(), NoConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
     623
     624        def addCPUDependentSourceFiles(self, cpu, files, cflags = None):
    618625                self.initCPUDependencies(cpu)
    619                 self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
    620 
    621         def addTargetSourceCPUDependentSourceFiles(self, targetCPUs, sourceCPU, files):
     626                self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(), FromRTEMSToFreeBSDSourceConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
     627
     628        def addTargetSourceCPUDependentSourceFiles(self, targetCPUs, sourceCPU, files, cflags = None):
    622629                for cpu in targetCPUs:
    623630                        self.initCPUDependencies(cpu)
    624                         self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU), FromFreeBSDToRTEMSSourceConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer())
     631                        self.cpuDependentSourceFiles [cpu] = self.addFiles(self.cpuDependentSourceFiles [cpu], files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU), FromFreeBSDToRTEMSSourceConverter(), NoConverter(), assertSourceFile, SourceFileMakefileFragmentComposer(cflags))
    625632
    626633        def addTest(self, testName, fileFragments, runTest = True, netTest = False):
Note: See TracChangeset for help on using the changeset viewer.