Example #1
0
 def dbgtgts(self):
     self.c_dbg_target = '$(C_TARGET)_debug'
     self.rtgts['$(BIN_DIR)/' + self.c_dbg_target] = {'deps': [], 'cmd': ['\t', '$(LD)', '$$(pkg-config --libs $(MODULES) 2> /dev/null)', '$(DBGFLAGS)', '$^', '-o', '$@']}
     self.targets.append(['debug', ['$(BIN_DIR)/' + self.c_dbg_target]])
     c2o = re.compile('\\.c$|\\.cpp$')
     drt = re.compile('\\\\\n|\n$', re.S)
     for c in self.clist:
         [ret, out, err] = cli.asystem(['gcc', '-MM', c] + self.makevar['CFLAGS'])#TODO
         if err:
             print(err)
             exit(ret)
         ofile = '$(OBJ_DIR)' + '/' + c2o.sub('_debug.o', c)
         self.rtgts[ofile] = {'deps': [drt.sub('', out.split(':', 1)[1])],
             'cmd': ['\t', '$(CC)', '$$(pkg-config --cflags $(MODULES))',
                     '$(DBGFLAGS)', '$(CFLAGS)', '-c', '$<', '-o', '$@']}
         self.rtgts['$(BIN_DIR)/' + self.c_dbg_target]['deps'].append(ofile)
     for cxx in self.cxxlist:
         [ret, out, err] = cli.asystem(['gcc', '-MM', c] + self.makevar['CXXFLAGS'])#TODO
         if err:
             print(err)
             exit(ret)
         ofile = '$(OBJ_DIR)' + '/' + c2o.sub('_debug.o', c)
         self.rtgts[ofile] = {'deps': [drt.sub('', out.split(':', 1)[1])],
             'cmd': ['\t', '$(CXX)', '$$(pkg-config --cflags $(MODULES))',
                     '$(DBGFLAGS)', '$(CXXFLAGS)', '-c', '$<', '-o', '$@']}
         self.rtgts['$(BIN_DIR)/' + self.c_dbg_target]['deps'].append(ofile)
Example #2
0
 def nmltgts(self):
     self.invar['C_TARGET'] = self.crvar['targets'][0] #TODO guess name
     self.rtgts['$(BIN_DIR)/$(C_TARGET)'] = {'deps': [], 'cmd': ['\t', '$(LD)', '$$(pkg-config --libs $(MODULES) 2> /dev/null)', '$(OPTFLAGS)', '$^', '-o', '$@']}
     self.targets[0][1] = ['$(BIN_DIR)/$(C_TARGET)']
     self.instl_target['$(BIN_DIR)/$(C_TARGET)'] = ['bin', 0o755]
     c2o = re.compile('\\.c$|\\.cpp$')
     drt = re.compile('\\\\\n|\n$', re.S)
     for c in self.clist:
         [ret, out, err] = cli.asystem(['gcc', '-MM', c] + self.makevar['CFLAGS'])#TODO
         if err:
             print(err)
             exit(ret)
         ofile = '$(OBJ_DIR)' + '/' + c2o.sub('.o', c)
         self.rtgts[ofile] = {'deps': [drt.sub('', out.split(':', 1)[1])],
             'cmd': ['\t', '$(CC)', '$$(pkg-config --cflags $(MODULES))',
                     '$(OPTFLAGS)', '$(CFLAGS)', '-c', '$<', '-o', '$@']}
         self.rtgts['$(BIN_DIR)/$(C_TARGET)']['deps'].append(ofile)
     for cxx in self.cxxlist:
         [ret, out, err] = cli.asystem(['gcc', '-MM', c] + self.makevar['CXXFLAGS'])#TODO
         if err:
             print(err)
             exit(ret)
         ofile = '$(OBJ_DIR)' + '/' + c2o.sub('.o', c)
         self.rtgts[ofile] = {'deps': [drt.sub('', out.split(':', 1)[1])],
             'cmd': ['\t', '$(CXX)', '$$(pkg-config --cflags $(MODULES))',
                     '$(OPTFLAGS)', '$(CXXFLAGS)', '-c', '$<', '-o', '$@']}
         self.rtgts['$(BIN_DIR)/$(C_TARGET)']['deps'].append(ofile)