source: rtems-libbsd/freebsd-to-rtems.py @ 24600f2

4.1155-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 24600f2 was 24600f2, checked in by Joel Sherrill <joel.sherrill@…>, on 03/08/12 at 18:52:46

All RTEMS files should now be under RTEMS

  • Also add "Makefile only" mode to freebsd-to-rtems.py
  • Property mode set to 100755
File size: 39.8 KB
Line 
1#! /usr/bin/python
2#
3#  Copyright (c) 2009-2011 embedded brains GmbH.  All rights reserved.
4#
5#   embedded brains GmbH
6#   Obere Lagerstr. 30
7#   82178 Puchheim
8#   Germany
9#   <info@embedded-brains.de>
10#
11#  Redistribution and use in source and binary forms, with or without
12#  modification, are permitted provided that the following conditions
13#  are met:
14#  1. Redistributions of source code must retain the above copyright
15#     notice, this list of conditions and the following disclaimer.
16#  2. Redistributions in binary form must reproduce the above copyright
17#     notice, this list of conditions and the following disclaimer in the
18#     documentation and/or other materials provided with the distribution.
19#
20#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32# FreeBSD: http://svn.freebsd.org/base/releng/8.2/sys (revision 222485)
33
34import shutil
35import os
36import re
37import sys
38import getopt
39
40RTEMS_DIR = "not_set"
41FreeBSD_DIR = "not_set"
42isVerbose = False
43isForward = True
44isDryRun = False
45isEarlyExit = False
46isOnlyMakefile = False
47
48def usage():
49  print "freebsd-to-rtems.py [args]"
50  print "  -?|-h|--help     print this and exit"
51  print "  -d|--dry-run     run program but no modifications"
52  print "  -e|--early-exit  evaluate arguments, print results, and exit"
53  print "  -m|--makefile    just generate Makefile"
54  print "  -R|--reverse     default FreeBSD -> RTEMS, reverse that"
55  print "  -r|--rtems       RTEMS directory"
56  print "  -f|--freebsd     FreeBSD directory"
57  print "  -v|--verbose     enable verbose output mode"
58
59# Parse the arguments
60def parseArguments():
61  global RTEMS_DIR, FreeBSD_DIR
62  global isVerbose, isForward, isEarlyExit, isOnlyMakefile
63  try:
64    opts, args = getopt.getopt(sys.argv[1:], "?hdemRr:f:v",
65                 ["help",
66                  "help",
67                  "dry-run"
68                  "early-exit"
69                  "makefile"
70                  "reverse"
71                  "rtems="
72                  "freebsd="
73                  "verbose"
74                 ]
75                )
76  except getopt.GetoptError, err:
77    # print help information and exit:
78    print str(err) # will print something like "option -a not recognized"
79    usage()
80    sys.exit(2)
81  for o, a in opts:
82    if o == "-v":
83      isVerbose = True
84    elif o in ("-h", "--help", "-?"):
85      usage()
86      sys.exit()
87    elif o in ("-d", "--dry-run"):
88      isForward = False
89    elif o in ("-e", "--early-exit"):
90      isEarlyExit = True
91    elif o in ("-m", "--makefile"):
92      isOnlyMakefile = True
93    elif o in ("-R", "--reverse"):
94      isForward = False
95    elif o in ("-r", "--rtems"):
96      RTEMS_DIR = a
97    elif o in ("-r", "--rtems"):
98      RTEMS_DIR = a
99    elif o in ("-f", "--freebsd"):
100      FreeBSD_DIR = a
101    else:
102       assert False, "unhandled option"
103
104parseArguments()
105print "Verbose:                " + ("no", "yes")[isVerbose]
106print "Dry Run:                " + ("no", "yes")[isDryRun]
107print "Only Generate Makefile: " + ("no", "yes")[isOnlyMakefile]
108print "RTEMS Directory:        " + RTEMS_DIR
109print "FreeBSD Directory:      " + FreeBSD_DIR
110print "Direction:              " + ("reverse", "forward")[isForward]
111
112# Check directory argument was set and exist
113def wasDirectorySet(desc, path):
114    if path == "not_set":
115        print desc + " Directory was not specified on command line"
116        sys.exit(2)
117
118    if os.path.isdir( path ) != True:
119        print desc + " Directory (" + path + ") does not exist"
120        sys.exit(2)
121
122# Were RTEMS and FreeBSD directories specified
123wasDirectorySet( "RTEMS", RTEMS_DIR )
124wasDirectorySet( "FreeBSD", FreeBSD_DIR )
125 
126# Are we generating or reverting?
127if isForward == True:
128    print "Generating into", RTEMS_DIR
129else:
130    print "Reverting from", RTEMS_DIR
131    if isOnlyMakefile == True:
132        print "Only Makefile Mode and Reverse are contradictory"
133        sys.exit(2)
134
135if isEarlyExit == True:
136    print "Early exit at user request"
137    sys.exit(0)
138 
139# Prefix added to FreeBSD files as they are copied into the RTEMS
140# build tree.
141PREFIX = 'freebsd'
142
143def mapContribPath(path):
144        m = re.match('(.*)(' + PREFIX + '/)(contrib/\\w+/)(.*)', path)
145        if m:
146                path = m.group(1) + m.group(3) + m.group(2) + m.group(4)
147        return path
148
149# generate an empty file as a place holder
150def installEmptyFile(src):
151        dst = RTEMS_DIR + '/' + PREFIX + '/' + src.replace('rtems/', '')
152        if isVerbose == True:
153                print "Install empty - " + dst
154        if isDryRun == True:
155                return
156        try:
157                os.makedirs(os.path.dirname(dst))
158        except OSError:
159                pass
160        out = open(dst, 'w')
161        out.write('/* EMPTY */\n')
162        out.close()
163
164# fix include paths inside a C or .h file
165def fixIncludes(data):
166        data = re.sub('#([ \t]*)include <', '#\\1include <' + PREFIX + '/', data)
167        data = re.sub('#include <' + PREFIX + '/rtems', '#include <rtems', data)
168        data = re.sub('#include <' + PREFIX + '/bsp', '#include <bsp', data)
169        data = re.sub('#include "([^"]*)"', '#include <' + PREFIX + '/local/\\1>', data)
170        data = re.sub('_H_', '_HH_', data)
171        return data
172
173# revert fixing the include paths inside a C or .h file
174def revertFixIncludes(data):
175        data = re.sub('_HH_', '_H_', data)
176        data = re.sub('#include <' + PREFIX + '/local/([^>]*)>', '#include "\\1"', data)
177        data = re.sub('#([ \t]*)include <' + PREFIX + '/', '#\\1include <', data)
178        return data
179
180# Copy a header file from FreeBSD to the RTEMS BSD tree
181def installHeaderFile(org):
182        src = FreeBSD_DIR + '/' + org
183        dst = RTEMS_DIR + '/' + PREFIX + '/' + org # + org.replace('rtems/', '')
184        dst = mapContribPath(dst)
185        if isVerbose == True:
186                print "Install Header - " + src + " => " + dst
187        if isDryRun == True:
188                return
189        try:
190                os.makedirs(os.path.dirname(dst))
191        except OSError:
192                pass
193        data = open(src).read()
194        out = open(dst, 'w')
195        if src.find('rtems') == -1:
196                data = fixIncludes(data)
197        out.write(data)
198        out.close()
199
200# Copy a source file from FreeBSD to the RTEMS BSD tree
201def installSourceFile(org):
202        src = FreeBSD_DIR + '/' + org
203        dst = RTEMS_DIR + '/' + PREFIX + '/' + org
204        dst = mapContribPath(dst)
205        if isVerbose == True:
206                print "Install Source - " + src + " => " + dst
207        if isDryRun == True:
208                return
209        try:
210                os.makedirs(os.path.dirname(dst))
211        except OSError:
212                pass
213        data = open(src).read()
214        out = open(dst, 'w')
215        if src.find('rtems') == -1:
216                data = fixIncludes(data)
217                out.write('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n')
218        out.write(data)
219        out.close()
220
221# Revert a header file from the RTEMS BSD tree to the FreeBSD tree
222def revertHeaderFile(org):
223        src = RTEMS_DIR + '/' + PREFIX + '/' + org.replace('rtems/', '')
224        src = mapContribPath(src)
225        dst = FreeBSD_DIR + '/' + org
226        if isVerbose == True:
227                print "Revert Header - " + src + " => " + dst
228        if isDryRun == True:
229                return
230        try:
231                os.makedirs(os.path.dirname(dst))
232        except OSError:
233                pass
234        data = open(src).read()
235        out = open(dst, 'w')
236        if org.find('rtems') == -1:
237                data = revertFixIncludes(data)
238        out.write(data)
239        out.close()
240
241# Revert a source file from the RTEMS BSD tree to the FreeBSD tree
242def revertSourceFile(org):
243        src = RTEMS_DIR + '/' + PREFIX + '/' + org
244        src = mapContribPath(src)
245        dst = FreeBSD_DIR + '/' + org
246        if isVerbose == True:
247                print "Revert Source - " + src + " => " + dst
248        if isDryRun == True:
249                return
250        try:
251                os.makedirs(os.path.dirname(dst))
252        except OSError:
253                pass
254        data = open(src).read()
255        out = open(dst, 'w')
256        if org.find('rtems') == -1:
257                data = re.sub('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n', '', data)
258                data = revertFixIncludes(data)
259        out.write(data)
260        out.close()
261
262# Remove the output directory
263def deleteOutputDirectory():
264        if isVerbose == True:
265                print "Delete Directory - " + RTEMS_DIR
266        if isDryRun == True:
267                return
268        try:
269                shutil.rmtree(RTEMS_DIR)
270        except OSError:
271            pass
272
273# Module Manager - Collection of Modules
274class ModuleManager:
275        def __init__(self):
276                self.modules = []
277                self.emptyFiles = []
278
279        def addModule(self, module):
280                self.modules.append(module)
281
282        def addEmptyFiles(self, emptyFiles):
283                self.emptyFiles.extend(emptyFiles)
284
285        def copyFiles(self):
286                for f in self.emptyFiles:
287                        installEmptyFile(f)
288                for m in self.modules:
289                        for f in m.headerFiles:
290                                installHeaderFile(f)
291                        for f in m.sourceFiles:
292                                installSourceFile(f)
293
294        def revertFiles(self):
295                for m in self.modules:
296                        for f in m.headerFiles:
297                                revertHeaderFile(f)
298                        for f in m.sourceFiles:
299                                revertSourceFile(f)
300
301        def createMakefile(self):
302                if isVerbose == True:
303                        print "Create Makefile"
304                if isDryRun == True:
305                        return
306                data = 'include config.inc\n' \
307                        '\n' \
308                        'include $(RTEMS_MAKEFILE_PATH)/Makefile.inc\n' \
309                        'include $(RTEMS_CUSTOM)\n' \
310                        'include $(PROJECT_ROOT)/make/leaf.cfg\n' \
311                        '\n' \
312                        'CFLAGS += -ffreestanding \n' \
313                        'CFLAGS += -I . \n' \
314                        'CFLAGS += -I rtemsbsd \n' \
315                        'CFLAGS += -I contrib/altq \n' \
316                        'CFLAGS += -I contrib/pf \n' \
317                        'CFLAGS += -B $(INSTALL_BASE) \n' \
318                        'CFLAGS += -w \n' \
319                        'CFLAGS += -std=gnu99\n' \
320                        '\n'
321                data += 'C_FILES ='
322                for m in self.modules:
323                        for f in m.sourceFiles:
324                                f = PREFIX + '/' + f
325                                f = mapContribPath(f)
326                                data += ' \\\n\t' + f
327                for f in rtems_sourceFiles:
328                        f = 'rtemsbsd/' + f
329                        data += ' \\\n\t' + f
330
331                data += '\nC_O_FILES = $(C_FILES:%.c=%.o)\n' \
332                        'C_DEP_FILES = $(C_FILES:%.c=%.dep)\n' \
333                        '\n' \
334                        'LIB = libbsd.a\n' \
335                        '\n' \
336                        'all: lib_usb\n' \
337                        '\n' \
338                        '$(LIB): $(C_O_FILES)\n' \
339                        '\t$(AR) rcu $@ $^\n' \
340                        '\n' \
341                        'lib_usb:\n' \
342                        '\tmake $(LIB)\n' \
343                        '\n' \
344                        'install: $(LIB)\n' \
345            '\tinstall -d $(INSTALL_BASE)/include\n' \
346            '\tinstall -c -m 644 $(LIB) $(INSTALL_BASE)\n' \
347            '\tcd rtemsbsd; for i in `find . -name \'*.h\'` ; do \\\n' \
348            '\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
349            '\tfor i in `find contrib freebsd -name \'*.h\'` ; do \\\n' \
350            '\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
351                        '\n' \
352                        'clean:\n' \
353                        '\trm -f -r $(PROJECT_INCLUDE)/rtems/freebsd\n' \
354                        '\trm -f $(LIB) $(C_O_FILES) $(C_DEP_FILES)\n' \
355                        '\n' \
356                        '-include $(C_DEP_FILES)\n'
357                out = open(RTEMS_DIR + '/Makefile', 'w')
358                out.write(data)
359                out.close()
360
361# Module - logical group of related files we can perform actions on
362class Module:
363        def __init__(self, name):
364                self.name = name
365                self.headerFiles = []
366                self.sourceFiles = []
367                self.dependencies = []
368
369        def addHeaderFiles(self, files):
370                self.headerFiles.extend(files)
371
372        def addSourceFiles(self, files):
373                self.sourceFiles.extend(files)
374
375        def addDependency(self, dep):
376                self.dependencies.append(dep)
377
378# Create Module Manager and supporting Modules
379#  - initialize each module with set of files associated
380mm = ModuleManager()
381
382rtems_headerFiles = [
383        'rtems/machine/in_cksum.h',  # logically a net file
384        'rtems/machine/atomic.h',
385        'rtems/machine/_bus.h',
386        'rtems/machine/bus.h',
387        'rtems/machine/bus_dma.h',
388        'rtems/machine/rtems-bsd-config.h',
389        'rtems/machine/clock.h',
390        'rtems/machine/cpufunc.h',
391        'rtems/machine/endian.h',
392        'rtems/machine/_limits.h',
393        'rtems/machine/_align.h',
394        'rtems/machine/mutex.h',
395        'rtems/machine/param.h',
396        'rtems/machine/pcpu.h',
397        #'rtems/machine/pmap.h',
398        'rtems/machine/proc.h',
399        'rtems/machine/resource.h',
400        'rtems/machine/runq.h',
401        'rtems/machine/signal.h',
402        'rtems/machine/stdarg.h',
403        'rtems/machine/_stdint.h',
404        'rtems/machine/_types.h',
405        'rtems/machine/ucontext.h',
406        'rtems/machine/rtems-bsd-symbols.h',
407        'rtems/machine/rtems-bsd-cache.h',
408        'rtems/machine/rtems-bsd-sysinit.h',
409        'rtems/machine/rtems-bsd-select.h',
410        #'rtems/machine/vm.h',
411        'bsd.h',
412        ]
413rtems_sourceFiles = [
414        'dev/usb/controller/ohci_lpc3250.c',
415        'src/rtems-bsd-cam.c',
416        'src/rtems-bsd-nexus.c',
417        'src/rtems-bsd-autoconf.c',
418        'src/rtems-bsd-delay.c',
419        'src/rtems-bsd-mutex.c',
420        'src/rtems-bsd-thread.c',
421        'src/rtems-bsd-condvar.c',
422        'src/rtems-bsd-lock.c',
423        'src/rtems-bsd-sx.c',
424        'src/rtems-bsd-rmlock.c',
425        'src/rtems-bsd-rwlock.c',
426        'src/rtems-bsd-generic.c',
427        'src/rtems-bsd-panic.c',
428        'src/rtems-bsd-synch.c',
429        'src/rtems-bsd-signal.c',
430        'src/rtems-bsd-callout.c',
431        'src/rtems-bsd-init.c',
432        'src/rtems-bsd-init-with-irq.c',
433        'src/rtems-bsd-assert.c',
434        'src/rtems-bsd-prot.c',
435        'src/rtems-bsd-resource.c',
436        'src/rtems-bsd-jail.c',
437        'src/rtems-bsd-shell.c',
438        'src/rtems-bsd-syscalls.c',
439        #'src/rtems-bsd-socket.c',
440        #'src/rtems-bsd-mbuf.c',
441        'src/rtems-bsd-malloc.c',
442        'src/rtems-bsd-support.c',
443        'src/rtems-bsd-bus-dma.c',
444        'src/rtems-bsd-sysctl.c',
445        'src/rtems-bsd-sysctlbyname.c',
446        'src/rtems-bsd-sysctlnametomib.c',
447        'src/rtems-bsd-uma.c',
448        ]
449# RTEMS files handled separately from modules
450# rtems = Module('rtems')
451# rtems.addHeaderFiles( rtems_headerFiles )
452# rtems.addSourceFiles( rtems_sourceFiles )
453
454local = Module('local')
455# RTEMS has its own local/pmap.h
456local.addHeaderFiles(
457        [
458                'local/bus_if.h',
459                'local/device_if.h',
460                #'local/linker_if.h',
461                'local/opt_bus.h',
462                'local/opt_cam.h',
463                'local/opt_compat.h',
464                'local/opt_ddb.h',
465                'local/opt_hwpmc_hooks.h',
466                'local/opt_init_path.h',
467                'local/opt_ktrace.h',
468                'local/opt_printf.h',
469                'local/opt_scsi.h',
470                'local/opt_usb.h',
471                'local/opt_inet.h',
472                'local/opt_inet6.h',
473                'local/opt_altq.h',
474                'local/opt_atalk.h',
475                'local/opt_bootp.h',
476                'local/opt_bpf.h',
477                'local/opt_bus.h',
478                'local/opt_cam.h',
479                'local/opt_carp.h',
480                'local/opt_compat.h',
481                'local/opt_config.h',
482                'local/opt_cpu.h',
483                'local/opt_ddb.h',
484                'local/opt_device_polling.h',
485                'local/opt_ef.h',
486                'local/opt_enc.h',
487                'local/opt_hwpmc_hooks.h',
488                'local/opt_inet6.h',
489                'local/opt_inet.h',
490                'local/opt_init_path.h',
491                'local/opt_ipdivert.h',
492                'local/opt_ipdn.h',
493                'local/opt_ipfw.h',
494                'local/opt_ipsec.h',
495                'local/opt_ipstealth.h',
496                'local/opt_ipx.h',
497                'local/opt_kdb.h',
498                'local/opt_kdtrace.h',
499                'local/opt_ktrace.h',
500                'local/opt_mbuf_profiling.h',
501                'local/opt_mbuf_stress_test.h',
502                'local/opt_mpath.h',
503                'local/opt_mrouting.h',
504                'local/opt_natm.h',
505                'local/opt_netgraph.h',
506                'local/opt_param.h',
507                'local/opt_posix.h',
508                'local/opt_pf.h',
509                'local/opt_printf.h',
510                'local/opt_route.h',
511                'local/opt_scsi.h',
512                'local/opt_sctp.h',
513                'local/opt_tcpdebug.h',
514                'local/opt_tdma.h',
515                'local/opt_usb.h',
516                'local/opt_vlan.h',
517                'local/opt_wlan.h',
518                'local/opt_zero.h',
519                'local/usbdevs_data.h',
520                'local/usbdevs.h',
521                'local/usb_if.h',
522                'local/vnode_if.h',
523                'local/vnode_if_newproto.h',
524                'local/vnode_if_typedef.h',
525                'local/cryptodev_if.h',
526                'local/miibus_if.h',
527                'local/miidevs.h',
528        ]
529)
530local.addSourceFiles(
531        [
532                'local/usb_if.c',
533                'local/bus_if.c',
534                #'local/linker_if.c',
535                'local/device_if.c',
536                'local/cryptodev_if.c',
537                'local/miibus_if.c',
538        ]
539)
540
541devUsb = Module('dev_usb')
542devUsb.addHeaderFiles(
543        [
544                'dev/usb/ufm_ioctl.h',
545                'dev/usb/usb_busdma.h',
546                'dev/usb/usb_bus.h',
547                'dev/usb/usb_cdc.h',
548                'dev/usb/usb_controller.h',
549                'dev/usb/usb_core.h',
550                'dev/usb/usb_debug.h',
551                'dev/usb/usb_dev.h',
552                'dev/usb/usb_device.h',
553                'dev/usb/usbdi.h',
554                'dev/usb/usbdi_util.h',
555                'dev/usb/usb_dynamic.h',
556                'dev/usb/usb_endian.h',
557                'dev/usb/usb_freebsd.h',
558                'dev/usb/usb_generic.h',
559                'dev/usb/usb.h',
560                'dev/usb/usbhid.h',
561                'dev/usb/usb_hub.h',
562                'dev/usb/usb_ioctl.h',
563                'dev/usb/usb_mbuf.h',
564                'dev/usb/usb_msctest.h',
565                'dev/usb/usb_process.h',
566                'dev/usb/usb_request.h',
567                'dev/usb/usb_transfer.h',
568                'dev/usb/usb_util.h',
569        ]
570)
571devUsb.addSourceFiles(
572        [
573                'dev/usb/usb_busdma.c',
574                'dev/usb/usb_core.c',
575                'dev/usb/usb_debug.c',
576                'dev/usb/usb_dev.c',
577                'dev/usb/usb_device.c',
578                'dev/usb/usb_dynamic.c',
579                'dev/usb/usb_error.c',
580                'dev/usb/usb_generic.c',
581                'dev/usb/usb_handle_request.c',
582                'dev/usb/usb_hid.c',
583                'dev/usb/usb_hub.c',
584                'dev/usb/usb_lookup.c',
585                'dev/usb/usb_mbuf.c',
586                'dev/usb/usb_msctest.c',
587                'dev/usb/usb_parse.c',
588                'dev/usb/usb_process.c',
589                'dev/usb/usb_request.c',
590                'dev/usb/usb_transfer.c',
591                'dev/usb/usb_util.c',
592        ]
593)
594
595devUsbAddOn = Module('dev_usb_add_on')
596devUsbAddOn.addHeaderFiles(
597        [
598                'dev/usb/usb_pci.h',
599                'dev/usb/usb_compat_linux.h',
600        ]
601)
602devUsbAddOn.addSourceFiles(
603        [
604                'dev/usb/usb_compat_linux.c',
605        ]
606)
607
608devUsbBluetooth = Module('dev_usb_bluetooth')
609devUsbBluetooth.addDependency(devUsb)
610devUsbBluetooth.addHeaderFiles(
611        [
612                'dev/usb/bluetooth/ng_ubt_var.h',
613        ]
614)
615devUsbBluetooth.addSourceFiles(
616        [
617                'dev/usb/bluetooth/ng_ubt.c',
618                'dev/usb/bluetooth/ubtbcmfw.c',
619        ]
620)
621
622devUsbController = Module('dev_usb_controller')
623devUsbController.addDependency(devUsb)
624devUsbController.addHeaderFiles(
625        [
626                'dev/usb/controller/ohci.h',
627                'dev/usb/controller/ohcireg.h',
628                'dev/usb/controller/ehci.h',
629                'dev/usb/controller/ehcireg.h',
630        ]
631)
632devUsbController.addSourceFiles(
633        [
634                'dev/usb/controller/ohci.c',
635                'dev/usb/controller/ehci.c',
636                'dev/usb/controller/usb_controller.c',
637        ]
638)
639
640devUsbControllerAddOn = Module('dev_usb_controller_add_on')
641devUsbControllerAddOn.addDependency(devUsb)
642devUsbControllerAddOn.addHeaderFiles(
643        [
644                'dev/usb/controller/at91dci.h',
645                'dev/usb/controller/atmegadci.h',
646                'dev/usb/controller/musb_otg.h',
647                'dev/usb/controller/uss820dci.h',
648        ]
649)
650devUsbControllerAddOn.addSourceFiles(
651        [
652                'dev/usb/controller/at91dci_atmelarm.c',
653                'dev/usb/controller/at91dci.c',
654                'dev/usb/controller/atmegadci_atmelarm.c',
655                'dev/usb/controller/atmegadci.c',
656                'dev/usb/controller/ehci_ixp4xx.c',
657                'dev/usb/controller/ehci_pci.c',
658                'dev/usb/controller/musb_otg.c',
659                'dev/usb/controller/ehci_mbus.c',
660                'dev/usb/controller/musb_otg_atmelarm.c',
661                'dev/usb/controller/ohci_atmelarm.c',
662                'dev/usb/controller/ohci_pci.c',
663                'dev/usb/controller/uhci_pci.c',
664                'dev/usb/controller/uss820dci_atmelarm.c',
665                'dev/usb/controller/uss820dci.c',
666        ]
667)
668
669devUsbInput = Module('dev_usb_input')
670devUsbInput.addDependency(devUsb)
671devUsbInput.addHeaderFiles(
672        [
673                'dev/usb/input/usb_rdesc.h',
674        ]
675)
676devUsbInput.addSourceFiles(
677        [
678                'dev/usb/input/uhid.c',
679                'dev/usb/input/ukbd.c',
680        ]
681)
682
683devUsbInputMouse = Module('dev_usb_mouse')
684devUsbInputMouse.addDependency(devUsb)
685devUsbInputMouse.addHeaderFiles(
686        [
687                'sys/tty.h',
688                'sys/mouse.h',
689                'sys/ttyqueue.h',
690                'sys/ttydefaults.h',
691                'sys/ttydisc.h',
692                'sys/ttydevsw.h',
693                'sys/ttyhook.h',
694        ]
695)
696devUsbInputMouse.addSourceFiles(
697        [
698                'dev/usb/input/ums.c',
699        ]
700)
701
702devUsbMisc = Module('dev_usb_misc')
703devUsbMisc.addDependency(devUsb)
704devUsbMisc.addHeaderFiles(
705        [
706                'dev/usb/misc/udbp.h',
707        ]
708)
709devUsbMisc.addSourceFiles(
710        [
711                'dev/usb/misc/udbp.c',
712                'dev/usb/misc/ufm.c',
713        ]
714)
715
716devUsbNet = Module('dev_usb_net')
717devUsbNet.addDependency(devUsb)
718devUsbNet.addHeaderFiles(
719        [
720                'dev/mii/mii.h',
721                'dev/mii/miivar.h',
722                'net/bpf.h',
723                'net/ethernet.h',
724                'net/if_arp.h',
725                'net/if_dl.h',
726                'net/if.h',
727                'net/if_media.h',
728                'net/if_types.h',
729                'net/if_var.h',
730                'net/vnet.h',
731                'dev/usb/net/if_cdcereg.h',
732                'dev/usb/net/usb_ethernet.h',
733        ]
734)
735devUsbNet.addSourceFiles(
736        [
737                'dev/usb/net/if_cdce.c',
738                'dev/usb/net/usb_ethernet.c',
739        ]
740)
741
742devUsbQuirk = Module('dev_usb_quirk')
743devUsbQuirk.addDependency(devUsb)
744devUsbQuirk.addHeaderFiles(
745        [
746                'dev/usb/quirk/usb_quirk.h',
747        ]
748)
749devUsbQuirk.addSourceFiles(
750        [
751                'dev/usb/quirk/usb_quirk.c',
752        ]
753)
754
755devUsbSerial = Module('dev_usb_serial')
756devUsbSerial.addDependency(devUsb)
757devUsbSerial.addHeaderFiles(
758        [
759                'dev/usb/serial/uftdi_reg.h',
760                'dev/usb/serial/usb_serial.h',
761        ]
762)
763devUsbSerial.addSourceFiles(
764        [
765                'dev/usb/serial/u3g.c',
766                'dev/usb/serial/uark.c',
767                'dev/usb/serial/ubsa.c',
768                'dev/usb/serial/ubser.c',
769                'dev/usb/serial/uchcom.c',
770                'dev/usb/serial/ucycom.c',
771                'dev/usb/serial/ufoma.c',
772                'dev/usb/serial/uftdi.c',
773                'dev/usb/serial/ugensa.c',
774                'dev/usb/serial/uipaq.c',
775                'dev/usb/serial/ulpt.c',
776                'dev/usb/serial/umct.c',
777                'dev/usb/serial/umodem.c',
778                'dev/usb/serial/umoscom.c',
779                'dev/usb/serial/uplcom.c',
780                'dev/usb/serial/usb_serial.c',
781                'dev/usb/serial/uslcom.c',
782                'dev/usb/serial/uvisor.c',
783                'dev/usb/serial/uvscom.c',
784        ]
785)
786
787devUsbStorage = Module('dev_usb_storage')
788devUsbStorage.addDependency(devUsb)
789devUsbStorage.addSourceFiles(
790        [
791                'dev/usb/storage/umass.c',
792        ]
793)
794
795devUsbStorageAddOn = Module('dev_usb_storage_add_on')
796devUsbStorageAddOn.addDependency(devUsb)
797devUsbStorageAddOn.addHeaderFiles(
798        [
799                'dev/usb/storage/rio500_usb.h',
800        ]
801)
802devUsbStorageAddOn.addSourceFiles(
803        [
804                'dev/usb/storage/urio.c',
805                'dev/usb/storage/ustorage_fs.c',
806        ]
807)
808
809devUsbTemplate = Module('dev_usb_template')
810devUsbTemplate.addDependency(devUsb)
811devUsbTemplate.addHeaderFiles(
812        [
813                'dev/usb/template/usb_template.h',
814        ]
815)
816devUsbTemplate.addSourceFiles(
817        [
818                'dev/usb/template/usb_template.c',
819                'dev/usb/template/usb_template_cdce.c',
820                'dev/usb/template/usb_template_msc.c',
821                'dev/usb/template/usb_template_mtp.c',
822        ]
823)
824
825devUsbWlan = Module('dev_usb_wlan')
826devUsbWlan.addDependency(devUsb)
827devUsbWlan.addHeaderFiles(
828        [
829                'dev/usb/wlan/if_rumfw.h',
830                'dev/usb/wlan/if_rumreg.h',
831                'dev/usb/wlan/if_rumvar.h',
832                'dev/usb/wlan/if_uathreg.h',
833                'dev/usb/wlan/if_uathvar.h',
834                'dev/usb/wlan/if_upgtvar.h',
835                'dev/usb/wlan/if_uralreg.h',
836                'dev/usb/wlan/if_uralvar.h',
837                'dev/usb/wlan/if_zydfw.h',
838                'dev/usb/wlan/if_zydreg.h',
839        ]
840)
841devUsbWlan.addSourceFiles(
842        [
843                'dev/usb/wlan/if_rum.c',
844                'dev/usb/wlan/if_uath.c',
845                'dev/usb/wlan/if_upgt.c',
846                'dev/usb/wlan/if_ural.c',
847                'dev/usb/wlan/if_zyd.c',
848        ]
849)
850
851devPci = Module('dev_pci')
852devPci.addHeaderFiles(
853        [
854                'dev/pci/pcireg.h',
855                'dev/pci/pcivar.h',
856        ]
857)
858
859devUsbBase = Module('dev_usb_base')
860devUsbBase.addHeaderFiles(
861        [
862                'bsm/audit.h',
863                'bsm/audit_kevents.h',
864                'sys/acl.h',
865                'sys/bufobj.h',
866                'sys/_bus_dma.h',
867                'sys/bus_dma.h',
868                'sys/bus.h',
869                'sys/callout.h',
870                'sys/cdefs.h',
871                'sys/condvar.h',
872                'sys/conf.h',
873                #'sys/cpuset.h',
874                'sys/ctype.h',
875                'sys/endian.h',
876                'sys/errno.h',
877                'sys/event.h',
878                'sys/eventhandler.h',
879                'sys/fcntl.h',
880                'sys/filedesc.h',
881                'sys/file.h',
882                'sys/filio.h',
883                'sys/ioccom.h',
884                'sys/_iovec.h',
885                'sys/kernel.h',
886                'sys/kobj.h',
887                'sys/kthread.h',
888                'sys/ktr.h',
889                'sys/libkern.h',
890                'sys/linker_set.h',
891                'sys/_lock.h',
892                'sys/lock.h',
893                'sys/_lockmgr.h',
894                'sys/lockmgr.h',
895                'sys/lock_profile.h',
896                'sys/lockstat.h',
897                'sys/mac.h',
898                'sys/malloc.h',
899                'sys/mbuf.h',
900                'sys/module.h',
901                'sys/mount.h',
902                'sys/_mutex.h',
903                'sys/mutex.h',
904                'sys/_null.h',
905                'sys/osd.h',
906                'sys/param.h',
907                'sys/pcpu.h',
908                'sys/poll.h',
909                'sys/priority.h',
910                'sys/priv.h',
911                'sys/proc.h',
912                'sys/queue.h',
913                'sys/refcount.h',
914                'sys/resource.h',
915                'sys/resourcevar.h',
916                'sys/rtprio.h',
917                'sys/runq.h',
918                'sys/_rwlock.h',
919                'sys/rwlock.h',
920                'sys/_semaphore.h',
921                'sys/selinfo.h',
922                'sys/sigio.h',
923                'sys/signal.h',
924                'sys/signalvar.h',
925                'sys/_sigset.h',
926                #'sys/sleepqueue.h',
927                'sys/socket.h',
928                'sys/stddef.h',
929                'sys/stdint.h',
930                'sys/_sx.h',
931                'sys/sx.h',
932                'sys/sysctl.h',
933                'sys/systm.h',
934                'sys/ttycom.h',
935                'sys/_types.h',
936                'sys/types.h',
937                'sys/ucontext.h',
938                'sys/ucred.h',
939                'sys/uio.h',
940                'sys/unistd.h',
941                #'sys/vmmeter.h',
942                #'sys/vnode.h',
943                'sys/rman.h',
944                'sys/reboot.h',
945                'sys/bitstring.h',
946                'sys/linker.h',
947                'vm/uma.h',
948                'vm/uma_int.h',
949                'vm/uma_dbg.h',
950                #'vm/vm.h',
951                #'vm/vm_page.h',
952                'fs/devfs/devfs_int.h',
953        ]
954)
955devUsbBase.addSourceFiles(
956        [
957                'kern/init_main.c',
958                #'kern/kern_linker.c',
959                #'kern/kern_mib.c',
960                'kern/kern_mbuf.c',
961                'kern/kern_module.c',
962                'kern/kern_sysctl.c',
963                'kern/subr_bus.c',
964                'kern/subr_kobj.c',
965                #'kern/subr_sleepqueue.c',
966                'kern/uipc_mbuf.c',
967                'kern/uipc_mbuf2.c',
968                'kern/uipc_socket.c',
969                #'kern/uipc_domain.c',
970                #'kern/uipc_syscalls.c',
971                #'vm/uma_core.c',
972        ]
973)
974
975cam = Module('cam')
976cam.addHeaderFiles(
977        [
978                'sys/ata.h',
979                'cam/cam.h',
980                'cam/cam_ccb.h',
981                'cam/cam_sim.h',
982                'cam/cam_xpt_sim.h',
983                'cam/scsi/scsi_all.h',
984                'cam/scsi/scsi_da.h',
985                'cam/ata/ata_all.h',
986                'cam/cam_periph.h',
987                'cam/cam_debug.h',
988                'cam/cam_xpt.h',
989        ]
990)
991cam.addSourceFiles(
992        [
993                'cam/cam.c',
994                'cam/scsi/scsi_all.c',
995        ]
996)
997
998devNet = Module('dev_net')
999devNet.addHeaderFiles(
1000        [
1001                'dev/mii/mii.h',
1002                'dev/mii/miivar.h',
1003                'dev/mii/icsphyreg.h',
1004                'net/bpf.h',
1005                'net/ethernet.h',
1006                'net/if_arp.h',
1007                'net/if_dl.h',
1008                'net/if.h',
1009                'net/if_media.h',
1010                'net/if_types.h',
1011                'net/if_var.h',
1012                'net/vnet.h',
1013        ]
1014)
1015devNet.addSourceFiles(
1016        [
1017                'dev/mii/mii.c',
1018                'dev/mii/mii_physubr.c',
1019                'dev/mii/icsphy.c',
1020        ]
1021)
1022
1023netDeps = Module('netDeps')
1024# logically machine/in_cksum.h is part of this group but RTEMS provides its own
1025netDeps.addHeaderFiles(
1026        [
1027                'security/mac/mac_framework.h',
1028                'sys/cpu.h',
1029                'sys/interrupt.h',
1030                'sys/fnv_hash.h',
1031                'sys/tree.h',
1032                'sys/taskqueue.h',
1033                'sys/buf_ring.h',
1034                'sys/rwlock.h',
1035                'sys/_rmlock.h',
1036                'sys/sockio.h',
1037                'sys/sdt.h',
1038                'sys/_task.h',
1039                'sys/sbuf.h',
1040                'sys/smp.h',
1041                'sys/syslog.h',
1042                'sys/jail.h',
1043                'sys/protosw.h',
1044                'sys/random.h',
1045                'sys/rmlock.h',
1046                'sys/hash.h',
1047                #'sys/select.h',
1048                'sys/sf_buf.h',
1049                'sys/socketvar.h',
1050                'sys/sockbuf.h',
1051                #'sys/sysproto.h',
1052                'sys/sockstate.h',
1053                'sys/sockopt.h',
1054                'sys/domain.h',
1055                'sys/time.h',
1056        ]
1057)
1058
1059net = Module('net')
1060net.addHeaderFiles(
1061        [
1062                'net/bpf_buffer.h',
1063                'net/bpfdesc.h',
1064                'net/bpf.h',
1065                'net/bpf_jitter.h',
1066                'net/bpf_zerocopy.h',
1067                'net/bridgestp.h',
1068                'net/ethernet.h',
1069                'net/fddi.h',
1070                'net/firewire.h',
1071                'net/flowtable.h',
1072                'net/ieee8023ad_lacp.h',
1073                'net/if_arc.h',
1074                'net/if_arp.h',
1075                'net/if_atm.h',
1076                'net/if_bridgevar.h',
1077                'net/if_clone.h',
1078                'net/if_dl.h',
1079                'net/if_enc.h',
1080                'net/if_gif.h',
1081                'net/if_gre.h',
1082                'net/if.h',
1083                'net/if_lagg.h',
1084                'net/if_llatbl.h',
1085                'net/if_llc.h',
1086                'net/if_media.h',
1087                'net/if_mib.h',
1088                'net/if_sppp.h',
1089                'net/if_stf.h',
1090                'net/if_tap.h',
1091                'net/if_tapvar.h',
1092                'net/if_tun.h',
1093                'net/if_types.h',
1094                'net/if_var.h',
1095                'net/if_vlan_var.h',
1096                'net/iso88025.h',
1097                'net/netisr.h',
1098                'net/pfil.h',
1099                'net/pfkeyv2.h',
1100                'net/ppp_defs.h',
1101                'net/radix.h',
1102                'net/radix_mpath.h',
1103                'net/raw_cb.h',
1104                'net/route.h',
1105                'net/slcompress.h',
1106                'net/vnet.h',
1107                'net/zlib.h',
1108        ]
1109)
1110net.addSourceFiles(
1111        [
1112                'net/bridgestp.c',
1113                'net/ieee8023ad_lacp.c',
1114                'net/if_atmsubr.c',
1115                'net/if.c',
1116                'net/if_clone.c',
1117                'net/if_dead.c',
1118                'net/if_disc.c',
1119                'net/if_edsc.c',
1120                'net/if_ef.c',
1121                'net/if_enc.c',
1122                'net/if_epair.c',
1123                'net/if_faith.c',
1124                'net/if_fddisubr.c',
1125                'net/if_fwsubr.c',
1126                'net/if_gif.c',
1127                'net/if_gre.c',
1128                'net/if_iso88025subr.c',
1129                'net/if_lagg.c',
1130                'net/if_llatbl.c',
1131                'net/if_loop.c',
1132                'net/if_media.c',
1133                'net/if_mib.c',
1134                'net/if_spppfr.c',
1135                'net/if_spppsubr.c',
1136                'net/if_stf.c',
1137                'net/if_tap.c',
1138                'net/if_tun.c',
1139                'net/if_vlan.c',
1140                'net/pfil.c',
1141                'net/radix.c',
1142                'net/radix_mpath.c',
1143                'net/raw_cb.c',
1144                'net/raw_usrreq.c',
1145                'net/route.c',
1146                'net/rtsock.c',
1147                'net/slcompress.c',
1148                'net/zlib.c',
1149                'net/bpf_buffer.c',
1150                'net/bpf.c',
1151                'net/bpf_filter.c',
1152                'net/bpf_jitter.c',
1153                'net/if_arcsubr.c',
1154                'net/if_bridge.c',
1155                'net/if_ethersubr.c',
1156                'net/netisr.c',
1157        ]
1158)
1159
1160netinet = Module('netinet')
1161netinet.addHeaderFiles(
1162        [
1163                'netinet/icmp6.h',
1164                'netinet/icmp_var.h',
1165                'netinet/if_atm.h',
1166                'netinet/if_ether.h',
1167                'netinet/igmp.h',
1168                'netinet/igmp_var.h',
1169                'netinet/in_gif.h',
1170                'netinet/in.h',
1171                'netinet/in_pcb.h',
1172                'netinet/in_systm.h',
1173                'netinet/in_var.h',
1174                'netinet/ip6.h',
1175                'netinet/ip_carp.h',
1176                'netinet/ip_divert.h',
1177                'netinet/ip_dummynet.h',
1178                'netinet/ip_ecn.h',
1179                'netinet/ip_encap.h',
1180                'netinet/ip_fw.h',
1181                'netinet/ip_gre.h',
1182                'netinet/ip.h',
1183                'netinet/ip_icmp.h',
1184                'netinet/ip_ipsec.h',
1185                'netinet/ip_mroute.h',
1186                'netinet/ip_options.h',
1187                'netinet/ip_var.h',
1188                'netinet/ipfw/ip_dn_private.h',
1189                'netinet/ipfw/ip_fw_private.h',
1190                'netinet/ipfw/dn_sched.h',
1191                'netinet/ipfw/dn_heap.h',
1192                'netinet/pim.h',
1193                'netinet/pim_var.h',
1194                'netinet/sctp_asconf.h',
1195                'netinet/sctp_auth.h',
1196                'netinet/sctp_bsd_addr.h',
1197                'netinet/sctp_cc_functions.h',
1198                'netinet/sctp_constants.h',
1199                'netinet/sctp_crc32.h',
1200                'netinet/sctp.h',
1201                'netinet/sctp_header.h',
1202                'netinet/sctp_indata.h',
1203                'netinet/sctp_input.h',
1204                'netinet/sctp_lock_bsd.h',
1205                'netinet/sctp_os_bsd.h',
1206                'netinet/sctp_os.h',
1207                'netinet/sctp_output.h',
1208                'netinet/sctp_pcb.h',
1209                'netinet/sctp_peeloff.h',
1210                'netinet/sctp_structs.h',
1211                'netinet/sctp_sysctl.h',
1212                'netinet/sctp_timer.h',
1213                'netinet/sctp_uio.h',
1214                'netinet/sctputil.h',
1215                'netinet/sctp_var.h',
1216                'netinet/tcp_debug.h',
1217                'netinet/tcp_fsm.h',
1218                'netinet/tcp.h',
1219                'netinet/tcp_hostcache.h',
1220                'netinet/tcpip.h',
1221                'netinet/tcp_lro.h',
1222                'netinet/tcp_offload.h',
1223                'netinet/tcp_seq.h',
1224                'netinet/tcp_syncache.h',
1225                'netinet/tcp_timer.h',
1226                'netinet/tcp_var.h',
1227                'netinet/toedev.h',
1228                'netinet/udp.h',
1229                'netinet/udp_var.h',
1230                'netinet/libalias/alias_local.h',
1231                'netinet/libalias/alias.h',
1232                'netinet/libalias/alias_mod.h',
1233                'netinet/libalias/alias_sctp.h',
1234        ]
1235)
1236netinet.addSourceFiles(
1237        [
1238                'netinet/accf_data.c',
1239                'netinet/accf_dns.c',
1240                'netinet/accf_http.c',
1241                'netinet/if_atm.c',
1242                'netinet/if_ether.c',
1243                'netinet/igmp.c',
1244                'netinet/in.c',
1245                'netinet/in_cksum.c',
1246                'netinet/in_gif.c',
1247                'netinet/in_mcast.c',
1248                'netinet/in_pcb.c',
1249                'netinet/in_proto.c',
1250                'netinet/in_rmx.c',
1251                'netinet/ip_carp.c',
1252                'netinet/ip_divert.c',
1253                'netinet/ip_ecn.c',
1254                'netinet/ip_encap.c',
1255                'netinet/ip_fastfwd.c',
1256                'netinet/ip_gre.c',
1257                'netinet/ip_icmp.c',
1258                'netinet/ip_id.c',
1259                'netinet/ip_input.c',
1260                'netinet/ip_ipsec.c',
1261                'netinet/ip_mroute.c',
1262                'netinet/ip_options.c',
1263                'netinet/ip_output.c',
1264                'netinet/raw_ip.c',
1265                'netinet/sctp_asconf.c',
1266                'netinet/sctp_auth.c',
1267                'netinet/sctp_bsd_addr.c',
1268                'netinet/sctp_cc_functions.c',
1269                'netinet/sctp_crc32.c',
1270                'netinet/sctp_indata.c',
1271                'netinet/sctp_input.c',
1272                'netinet/sctp_output.c',
1273                'netinet/sctp_pcb.c',
1274                'netinet/sctp_peeloff.c',
1275                'netinet/sctp_sysctl.c',
1276                'netinet/sctp_timer.c',
1277                'netinet/sctp_usrreq.c',
1278                'netinet/sctputil.c',
1279                'netinet/tcp_debug.c',
1280                #'netinet/tcp_hostcache.c',
1281                'netinet/tcp_input.c',
1282                'netinet/tcp_lro.c',
1283                'netinet/tcp_offload.c',
1284                'netinet/tcp_output.c',
1285                'netinet/tcp_reass.c',
1286                'netinet/tcp_sack.c',
1287                'netinet/tcp_subr.c',
1288                'netinet/tcp_syncache.c',
1289                'netinet/tcp_timer.c',
1290                'netinet/tcp_timewait.c',
1291                'netinet/tcp_usrreq.c',
1292                'netinet/udp_usrreq.c',
1293                'netinet/ipfw/dn_sched_fifo.c',
1294                'netinet/ipfw/dn_sched_rr.c',
1295                'netinet/ipfw/ip_fw_log.c',
1296                'netinet/ipfw/dn_sched_qfq.c',
1297                'netinet/ipfw/dn_sched_prio.c',
1298                #'netinet/ipfw/ip_fw_dynamic.c',
1299                'netinet/ipfw/ip_dn_glue.c',
1300                'netinet/ipfw/ip_fw2.c',
1301                'netinet/ipfw/dn_heap.c',
1302                'netinet/ipfw/ip_dummynet.c',
1303                'netinet/ipfw/ip_fw_sockopt.c',
1304                'netinet/ipfw/dn_sched_wf2q.c',
1305                'netinet/ipfw/ip_fw_nat.c',
1306                'netinet/ipfw/ip_fw_pfil.c',
1307                'netinet/ipfw/ip_dn_io.c',
1308                'netinet/ipfw/ip_fw_table.c',
1309                'netinet/libalias/alias_dummy.c',
1310                'netinet/libalias/alias_pptp.c',
1311                'netinet/libalias/alias_smedia.c',
1312                'netinet/libalias/alias_mod.c',
1313                'netinet/libalias/alias_cuseeme.c',
1314                'netinet/libalias/alias_nbt.c',
1315                'netinet/libalias/alias_irc.c',
1316                'netinet/libalias/alias_util.c',
1317                'netinet/libalias/alias_db.c',
1318                'netinet/libalias/alias_ftp.c',
1319                'netinet/libalias/alias_proxy.c',
1320                'netinet/libalias/alias.c',
1321                'netinet/libalias/alias_skinny.c',
1322                'netinet/libalias/alias_sctp.c',
1323        ]
1324)
1325
1326netinet6 = Module('netinet6')
1327netinet6.addHeaderFiles(
1328        [
1329                'netinet6/icmp6.h',
1330                'netinet6/in6_gif.h',
1331                'netinet6/in6.h',
1332                'netinet6/in6_ifattach.h',
1333                'netinet6/in6_pcb.h',
1334                'netinet6/in6_var.h',
1335                'netinet6/ip6_ecn.h',
1336                'netinet6/ip6.h',
1337                'netinet6/ip6_ipsec.h',
1338                'netinet6/ip6_mroute.h',
1339                'netinet6/ip6protosw.h',
1340                'netinet6/ip6_var.h',
1341                'netinet6/mld6.h',
1342                'netinet6/mld6_var.h',
1343                'netinet6/nd6.h',
1344                'netinet6/pim6.h',
1345                'netinet6/pim6_var.h',
1346                'netinet6/raw_ip6.h',
1347                'netinet6/scope6_var.h',
1348                'netinet6/sctp6_var.h',
1349                'netinet6/tcp6_var.h',
1350                'netinet6/udp6_var.h',
1351        ]
1352)
1353netinet6.addSourceFiles(
1354        [
1355                'netinet6/dest6.c',
1356                'netinet6/frag6.c',
1357                'netinet6/icmp6.c',
1358                'netinet6/in6.c',
1359                'netinet6/in6_cksum.c',
1360                'netinet6/in6_gif.c',
1361                'netinet6/in6_ifattach.c',
1362                'netinet6/in6_mcast.c',
1363                'netinet6/in6_pcb.c',
1364                'netinet6/in6_proto.c',
1365                'netinet6/in6_rmx.c',
1366                'netinet6/in6_src.c',
1367                'netinet6/ip6_forward.c',
1368                'netinet6/ip6_id.c',
1369                'netinet6/ip6_input.c',
1370                'netinet6/ip6_ipsec.c',
1371                'netinet6/ip6_mroute.c',
1372                'netinet6/ip6_output.c',
1373                'netinet6/mld6.c',
1374                'netinet6/nd6.c',
1375                'netinet6/nd6_nbr.c',
1376                'netinet6/nd6_rtr.c',
1377                'netinet6/raw_ip6.c',
1378                'netinet6/route6.c',
1379                'netinet6/scope6.c',
1380                'netinet6/sctp6_usrreq.c',
1381                'netinet6/udp6_usrreq.c',
1382        ]
1383)
1384
1385netipsec = Module('netipsec')
1386netipsec.addHeaderFiles(
1387        [
1388                'netipsec/ah.h',
1389                'netipsec/ah_var.h',
1390                'netipsec/esp.h',
1391                'netipsec/esp_var.h',
1392                'netipsec/ipcomp.h',
1393                'netipsec/ipcomp_var.h',
1394                'netipsec/ipip_var.h',
1395                'netipsec/ipsec6.h',
1396                'netipsec/ipsec.c',
1397                'netipsec/ipsec.h',
1398                'netipsec/keydb.h',
1399                'netipsec/key_debug.h',
1400                'netipsec/key.h',
1401                'netipsec/keysock.h',
1402                'netipsec/key_var.h',
1403                'netipsec/xform.h',
1404        ]
1405)
1406netipsec.addSourceFiles(
1407        [
1408                'netipsec/ipsec_input.c',
1409                'netipsec/ipsec_mbuf.c',
1410                'netipsec/ipsec_output.c',
1411                'netipsec/key.c',
1412                'netipsec/key_debug.c',
1413                'netipsec/keysock.c',
1414                'netipsec/xform_ah.c',
1415                'netipsec/xform_esp.c',
1416                'netipsec/xform_ipcomp.c',
1417                'netipsec/xform_ipip.c',
1418                'netipsec/xform_tcp.c',
1419        ]
1420)
1421
1422net80211 = Module('net80211')
1423net80211.addHeaderFiles(
1424        [
1425                'net80211/ieee80211_action.h',
1426                'net80211/ieee80211_adhoc.h',
1427                'net80211/ieee80211_ageq.h',
1428                'net80211/ieee80211_amrr.h',
1429                'net80211/ieee80211_crypto.h',
1430                'net80211/ieee80211_dfs.h',
1431                'net80211/ieee80211_freebsd.h',
1432                'net80211/_ieee80211.h',
1433                'net80211/ieee80211.h',
1434                'net80211/ieee80211_hostap.h',
1435                'net80211/ieee80211_ht.h',
1436                'net80211/ieee80211_input.h',
1437                'net80211/ieee80211_ioctl.h',
1438                'net80211/ieee80211_mesh.h',
1439                'net80211/ieee80211_monitor.h',
1440                'net80211/ieee80211_node.h',
1441                'net80211/ieee80211_phy.h',
1442                'net80211/ieee80211_power.h',
1443                'net80211/ieee80211_proto.h',
1444                'net80211/ieee80211_radiotap.h',
1445                'net80211/ieee80211_ratectl.h',
1446                'net80211/ieee80211_regdomain.h',
1447                'net80211/ieee80211_rssadapt.h',
1448                'net80211/ieee80211_scan.h',
1449                'net80211/ieee80211_sta.h',
1450                'net80211/ieee80211_superg.h',
1451                'net80211/ieee80211_tdma.h',
1452                'net80211/ieee80211_var.h',
1453                'net80211/ieee80211_wds.h',
1454        ]
1455)
1456netipsec.addSourceFiles(
1457        [
1458                'net80211/ieee80211_acl.c',
1459                'net80211/ieee80211_action.c',
1460                'net80211/ieee80211_adhoc.c',
1461                'net80211/ieee80211_ageq.c',
1462                'net80211/ieee80211_amrr.c',
1463                'net80211/ieee80211.c',
1464                'net80211/ieee80211_crypto.c',
1465                'net80211/ieee80211_crypto_ccmp.c',
1466                'net80211/ieee80211_crypto_none.c',
1467                'net80211/ieee80211_crypto_tkip.c',
1468                'net80211/ieee80211_crypto_wep.c',
1469                'net80211/ieee80211_ddb.c',
1470                'net80211/ieee80211_dfs.c',
1471                'net80211/ieee80211_freebsd.c',
1472                'net80211/ieee80211_hostap.c',
1473                'net80211/ieee80211_ht.c',
1474                'net80211/ieee80211_hwmp.c',
1475                'net80211/ieee80211_input.c',
1476                'net80211/ieee80211_ioctl.c',
1477                'net80211/ieee80211_mesh.c',
1478                'net80211/ieee80211_monitor.c',
1479                'net80211/ieee80211_node.c',
1480                'net80211/ieee80211_output.c',
1481                'net80211/ieee80211_phy.c',
1482                'net80211/ieee80211_power.c',
1483                'net80211/ieee80211_proto.c',
1484                'net80211/ieee80211_radiotap.c',
1485                'net80211/ieee80211_ratectl.c',
1486                'net80211/ieee80211_ratectl_none.c',
1487                'net80211/ieee80211_regdomain.c',
1488                'net80211/ieee80211_rssadapt.c',
1489                'net80211/ieee80211_scan.c',
1490                'net80211/ieee80211_scan_sta.c',
1491                'net80211/ieee80211_sta.c',
1492                'net80211/ieee80211_superg.c',
1493                'net80211/ieee80211_tdma.c',
1494                'net80211/ieee80211_wds.c',
1495                'net80211/ieee80211_xauth.c',
1496        ]
1497)
1498
1499opencrypto = Module('opencrypto')
1500opencrypto.addHeaderFiles(
1501        [
1502                'sys/md5.h',
1503                'opencrypto/deflate.h',
1504                'opencrypto/xform.h',
1505                'opencrypto/cryptosoft.h',
1506                'opencrypto/rmd160.h',
1507                'opencrypto/cryptodev.h',
1508                'opencrypto/castsb.h',
1509                'opencrypto/skipjack.h',
1510                'opencrypto/cast.h',
1511        ]
1512)
1513opencrypto.addSourceFiles(
1514        [
1515                'opencrypto/crypto.c',
1516                'opencrypto/deflate.c',
1517                'opencrypto/cryptosoft.c',
1518                'opencrypto/criov.c',
1519                'opencrypto/rmd160.c',
1520                'opencrypto/xform.c',
1521                'opencrypto/skipjack.c',
1522                'opencrypto/cast.c',
1523                'opencrypto/cryptodev.c',
1524        ]
1525)
1526
1527crypto = Module('crypto')
1528crypto.addHeaderFiles(
1529        [
1530                #'crypto/aesni/aesni.h',
1531                'crypto/sha1.h',
1532                'crypto/sha2/sha2.h',
1533                'crypto/rijndael/rijndael.h',
1534                'crypto/rijndael/rijndael_local.h',
1535                'crypto/rijndael/rijndael-api-fst.h',
1536                'crypto/des/des.h',
1537                'crypto/des/spr.h',
1538                'crypto/des/podd.h',
1539                'crypto/des/sk.h',
1540                'crypto/des/des_locl.h',
1541                'crypto/blowfish/bf_pi.h',
1542                'crypto/blowfish/bf_locl.h',
1543                'crypto/blowfish/blowfish.h',
1544                'crypto/rc4/rc4.h',
1545                #'crypto/via/padlock.h',
1546                'crypto/camellia/camellia.h',
1547        ]
1548)
1549crypto.addSourceFiles(
1550        [
1551                #'crypto/aesni/aesni.c',
1552                #'crypto/aesni/aesni_wrap.c',
1553                'crypto/sha1.c',
1554                'crypto/sha2/sha2.c',
1555                'crypto/rijndael/rijndael-alg-fst.c',
1556                'crypto/rijndael/rijndael-api.c',
1557                'crypto/rijndael/rijndael-api-fst.c',
1558                'crypto/des/des_setkey.c',
1559                'crypto/des/des_enc.c',
1560                'crypto/des/des_ecb.c',
1561                'crypto/blowfish/bf_enc.c',
1562                'crypto/blowfish/bf_skey.c',
1563                'crypto/blowfish/bf_ecb.c',
1564                'crypto/rc4/rc4.c',
1565                #'crypto/via/padlock.c',
1566                #'crypto/via/padlock_cipher.c',
1567                #'crypto/via/padlock_hash.c',
1568                'crypto/camellia/camellia-api.c',
1569                'crypto/camellia/camellia.c',
1570        ]
1571)
1572
1573altq = Module('altq')
1574altq.addHeaderFiles(
1575        [
1576                'contrib/altq/altq/altq_rmclass.h',
1577                'contrib/altq/altq/altq_cbq.h',
1578                'contrib/altq/altq/altq_var.h',
1579                'contrib/altq/altq/altqconf.h',
1580                'contrib/altq/altq/altq.h',
1581                'contrib/altq/altq/altq_hfsc.h',
1582                'contrib/altq/altq/altq_red.h',
1583                'contrib/altq/altq/altq_classq.h',
1584                'contrib/altq/altq/altq_priq.h',
1585                'contrib/altq/altq/altq_rmclass_debug.h',
1586                'contrib/altq/altq/altq_cdnr.h',
1587                'contrib/altq/altq/altq_rio.h',
1588                'contrib/altq/altq/if_altq.h',
1589        ]
1590)
1591altq.addSourceFiles(
1592        [
1593                'contrib/altq/altq/altq_rmclass.c',
1594                'contrib/altq/altq/altq_rio.c',
1595                'contrib/altq/altq/altq_subr.c',
1596                'contrib/altq/altq/altq_cdnr.c',
1597                'contrib/altq/altq/altq_priq.c',
1598                'contrib/altq/altq/altq_cbq.c',
1599                'contrib/altq/altq/altq_hfsc.c',
1600                'contrib/altq/altq/altq_red.c',
1601        ]
1602)
1603
1604pf = Module('pf')
1605pf.addHeaderFiles(
1606        [
1607                'contrib/pf/net/pf_mtag.h',
1608                'contrib/pf/net/if_pfsync.h',
1609                'contrib/pf/net/pfvar.h',
1610                'contrib/pf/net/if_pflog.h',
1611        ]
1612)
1613pf.addSourceFiles(
1614        [
1615                'contrib/pf/netinet/in4_cksum.c',
1616                'contrib/pf/net/pf.c',
1617                'contrib/pf/net/if_pflog.c',
1618                'contrib/pf/net/pf_subr.c',
1619                'contrib/pf/net/pf_ioctl.c',
1620                'contrib/pf/net/pf_table.c',
1621                'contrib/pf/net/pf_if.c',
1622                'contrib/pf/net/pf_osfp.c',
1623                'contrib/pf/net/pf_norm.c',
1624                'contrib/pf/net/pf_ruleset.c',
1625                'contrib/pf/net/if_pfsync.c',
1626        ]
1627)
1628
1629mm.addEmptyFiles(
1630        [
1631                'cam/cam_queue.h',
1632                'ddb/db_sym.h',
1633                'ddb/ddb.h',
1634                'machine/cpu.h',
1635                'machine/elf.h',
1636                'machine/sf_buf.h',
1637                #'machine/vmparam.h',
1638                'net/vnet.h',
1639                'security/audit/audit.h',
1640                'security/mac/mac_framework.h',
1641                'sys/bio.h',
1642                'sys/copyright.h',
1643                'sys/cpuset.h',
1644                'sys/errno.h',
1645                'sys/exec.h',
1646                'sys/fail.h',
1647                'sys/limits.h',
1648                'sys/namei.h',
1649                'sys/_pthreadtypes.h',
1650                #'sys/resourcevar.h',
1651                'sys/sbuf.h',
1652                'sys/sched.h',
1653                'sys/select.h',
1654                'sys/syscallsubr.h',
1655                'sys/sysent.h',
1656                'sys/syslimits.h',
1657                'sys/sysproto.h',
1658                'sys/stat.h',
1659                'sys/taskqueue.h',
1660                #'sys/time.h',
1661                'time.h',
1662                'sys/timespec.h',
1663                'sys/_timeval.h',
1664                #'sys/vmmeter.h',
1665                #'sys/vnode.h',
1666                #'vm/pmap.h',
1667                #'vm/uma_int.h',
1668                #'vm/uma_dbg.h',
1669                #'vm/vm_extern.h',
1670                #'vm/vm_map.h',
1671                #'vm/vm_object.h',
1672                #'vm/vm_page.h',
1673                #'vm/vm_pageout.h',
1674                #'vm/vm_param.h',
1675                #'vm/vm_kern.h',
1676                'dev/pci/pcireg.h',
1677                'dev/pci/pcivar.h',
1678                'geom/geom_disk.h',
1679                #'sys/kdb.h',
1680                #'libkern/jenkins.h',
1681                #'machine/pcb.h',
1682                #'net80211/ieee80211_freebsd.h',
1683                'netgraph/ng_ipfw.h',
1684                #'sys/sf_buf.h',
1685        ]
1686)
1687
1688# Register all the Module instances with the Module Manager
1689mm.addModule(netDeps)
1690mm.addModule(net)
1691mm.addModule(netinet)
1692mm.addModule(netinet6)
1693mm.addModule(netipsec)
1694mm.addModule(net80211)
1695mm.addModule(opencrypto)
1696mm.addModule(crypto)
1697mm.addModule(altq)
1698mm.addModule(pf)
1699mm.addModule(devNet)
1700
1701# mm.addModule(rtems)
1702mm.addModule(local)
1703mm.addModule(devUsbBase)
1704mm.addModule(devUsb)
1705mm.addModule(devUsbQuirk)
1706mm.addModule(devUsbController)
1707
1708mm.addModule(cam)
1709mm.addModule(devUsbStorage)
1710
1711#mm.addModule(devUsbNet)
1712
1713# Perform the actual file manipulation
1714if isForward == True:
1715    if isOnlyMakefile == False:
1716        mm.copyFiles()
1717    mm.createMakefile()
1718else:
1719    mm.revertFiles()
1720
Note: See TracBrowser for help on using the repository browser.