All RTEMS files should now be under RTEMS

- Also add "Makefile only" mode to freebsd-to-rtems.py
This commit is contained in:
Joel Sherrill
2012-03-08 12:52:46 -06:00
parent 1e8830f013
commit 24600f22ab
4 changed files with 58 additions and 55 deletions

View File

@@ -300,10 +300,10 @@ C_FILES = \
freebsd/dev/usb/controller/ohci.c \ freebsd/dev/usb/controller/ohci.c \
freebsd/dev/usb/controller/ehci.c \ freebsd/dev/usb/controller/ehci.c \
freebsd/dev/usb/controller/usb_controller.c \ freebsd/dev/usb/controller/usb_controller.c \
freebsd/dev/usb/controller/ohci_lpc3250.c \
freebsd/cam/cam.c \ freebsd/cam/cam.c \
freebsd/cam/scsi/scsi_all.c \ freebsd/cam/scsi/scsi_all.c \
freebsd/dev/usb/storage/umass.c \ freebsd/dev/usb/storage/umass.c \
rtemsbsd/dev/usb/controller/ohci_lpc3250.c \
rtemsbsd/src/rtems-bsd-cam.c \ rtemsbsd/src/rtems-bsd-cam.c \
rtemsbsd/src/rtems-bsd-nexus.c \ rtemsbsd/src/rtems-bsd-nexus.c \
rtemsbsd/src/rtems-bsd-autoconf.c \ rtemsbsd/src/rtems-bsd-autoconf.c \
@@ -349,7 +349,7 @@ lib_usb:
make $(LIB) make $(LIB)
install: $(LIB) install: $(LIB)
install -d "$(INSTALL_BASE)/include" install -d $(INSTALL_BASE)/include
install -c -m 644 $(LIB) $(INSTALL_BASE) install -c -m 644 $(LIB) $(INSTALL_BASE)
cd rtemsbsd; for i in `find . -name '*.h'` ; do \ cd rtemsbsd; for i in `find . -name '*.h'` ; do \
install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done

View File

@@ -41,14 +41,16 @@ RTEMS_DIR = "not_set"
FreeBSD_DIR = "not_set" FreeBSD_DIR = "not_set"
isVerbose = False isVerbose = False
isForward = True isForward = True
isDryRun = True isDryRun = False
isEarlyExit = False isEarlyExit = False
isOnlyMakefile = False
def usage(): def usage():
print "freebsd-to-rtems.py [args]" print "freebsd-to-rtems.py [args]"
print " -?|-h|--help print this and exit" print " -?|-h|--help print this and exit"
print " -d|--dry-run run program but no modifications" print " -d|--dry-run run program but no modifications"
print " -e|--early-exit evaluate arguments, print results, and exit" print " -e|--early-exit evaluate arguments, print results, and exit"
print " -m|--makefile just generate Makefile"
print " -R|--reverse default FreeBSD -> RTEMS, reverse that" print " -R|--reverse default FreeBSD -> RTEMS, reverse that"
print " -r|--rtems RTEMS directory" print " -r|--rtems RTEMS directory"
print " -f|--freebsd FreeBSD directory" print " -f|--freebsd FreeBSD directory"
@@ -56,13 +58,15 @@ def usage():
# Parse the arguments # Parse the arguments
def parseArguments(): def parseArguments():
global RTEMS_DIR, FreeBSD_DIR, isVerbose, isForward, isEarlyExit global RTEMS_DIR, FreeBSD_DIR
global isVerbose, isForward, isEarlyExit, isOnlyMakefile
try: try:
opts, args = getopt.getopt(sys.argv[1:], "?hdeRr:f:v", opts, args = getopt.getopt(sys.argv[1:], "?hdemRr:f:v",
["help", ["help",
"help", "help",
"dry-run" "dry-run"
"early-exit" "early-exit"
"makefile"
"reverse" "reverse"
"rtems=" "rtems="
"freebsd=" "freebsd="
@@ -84,6 +88,8 @@ def parseArguments():
isForward = False isForward = False
elif o in ("-e", "--early-exit"): elif o in ("-e", "--early-exit"):
isEarlyExit = True isEarlyExit = True
elif o in ("-m", "--makefile"):
isOnlyMakefile = True
elif o in ("-R", "--reverse"): elif o in ("-R", "--reverse"):
isForward = False isForward = False
elif o in ("-r", "--rtems"): elif o in ("-r", "--rtems"):
@@ -98,6 +104,7 @@ def parseArguments():
parseArguments() parseArguments()
print "Verbose: " + ("no", "yes")[isVerbose] print "Verbose: " + ("no", "yes")[isVerbose]
print "Dry Run: " + ("no", "yes")[isDryRun] print "Dry Run: " + ("no", "yes")[isDryRun]
print "Only Generate Makefile: " + ("no", "yes")[isOnlyMakefile]
print "RTEMS Directory: " + RTEMS_DIR print "RTEMS Directory: " + RTEMS_DIR
print "FreeBSD Directory: " + FreeBSD_DIR print "FreeBSD Directory: " + FreeBSD_DIR
print "Direction: " + ("reverse", "forward")[isForward] print "Direction: " + ("reverse", "forward")[isForward]
@@ -116,19 +123,14 @@ def wasDirectorySet(desc, path):
wasDirectorySet( "RTEMS", RTEMS_DIR ) wasDirectorySet( "RTEMS", RTEMS_DIR )
wasDirectorySet( "FreeBSD", FreeBSD_DIR ) wasDirectorySet( "FreeBSD", FreeBSD_DIR )
if os.path.isdir( FreeBSD_DIR ) != True:
print "FreeBSD Directory (" + FreeBSD_DIR + ") does not exist"
sys.exit(2)
if FreeBSD_DIR == RTEMS_DIR:
print "FreeBSD and RTEMS Directories are the same"
sys.exit(2)
# Are we generating or reverting? # Are we generating or reverting?
if isForward == True: if isForward == True:
print "Generating into", RTEMS_DIR print "Generating into", RTEMS_DIR
else: else:
print "Reverting from", RTEMS_DIR print "Reverting from", RTEMS_DIR
if isOnlyMakefile == True:
print "Only Makefile Mode and Reverse are contradictory"
sys.exit(2)
if isEarlyExit == True: if isEarlyExit == True:
print "Early exit at user request" print "Early exit at user request"
@@ -323,7 +325,7 @@ class ModuleManager:
f = mapContribPath(f) f = mapContribPath(f)
data += ' \\\n\t' + f data += ' \\\n\t' + f
for f in rtems_sourceFiles: for f in rtems_sourceFiles:
f = 'rtemsbsd/src/' + f f = 'rtemsbsd/' + f
data += ' \\\n\t' + f data += ' \\\n\t' + f
data += '\nC_O_FILES = $(C_FILES:%.c=%.o)\n' \ data += '\nC_O_FILES = $(C_FILES:%.c=%.o)\n' \
@@ -409,39 +411,40 @@ rtems_headerFiles = [
'bsd.h', 'bsd.h',
] ]
rtems_sourceFiles = [ rtems_sourceFiles = [
'rtems-bsd-cam.c', 'dev/usb/controller/ohci_lpc3250.c',
'rtems-bsd-nexus.c', 'src/rtems-bsd-cam.c',
'rtems-bsd-autoconf.c', 'src/rtems-bsd-nexus.c',
'rtems-bsd-delay.c', 'src/rtems-bsd-autoconf.c',
'rtems-bsd-mutex.c', 'src/rtems-bsd-delay.c',
'rtems-bsd-thread.c', 'src/rtems-bsd-mutex.c',
'rtems-bsd-condvar.c', 'src/rtems-bsd-thread.c',
'rtems-bsd-lock.c', 'src/rtems-bsd-condvar.c',
'rtems-bsd-sx.c', 'src/rtems-bsd-lock.c',
'rtems-bsd-rmlock.c', 'src/rtems-bsd-sx.c',
'rtems-bsd-rwlock.c', 'src/rtems-bsd-rmlock.c',
'rtems-bsd-generic.c', 'src/rtems-bsd-rwlock.c',
'rtems-bsd-panic.c', 'src/rtems-bsd-generic.c',
'rtems-bsd-synch.c', 'src/rtems-bsd-panic.c',
'rtems-bsd-signal.c', 'src/rtems-bsd-synch.c',
'rtems-bsd-callout.c', 'src/rtems-bsd-signal.c',
'rtems-bsd-init.c', 'src/rtems-bsd-callout.c',
'rtems-bsd-init-with-irq.c', 'src/rtems-bsd-init.c',
'rtems-bsd-assert.c', 'src/rtems-bsd-init-with-irq.c',
'rtems-bsd-prot.c', 'src/rtems-bsd-assert.c',
'rtems-bsd-resource.c', 'src/rtems-bsd-prot.c',
'rtems-bsd-jail.c', 'src/rtems-bsd-resource.c',
'rtems-bsd-shell.c', 'src/rtems-bsd-jail.c',
'rtems-bsd-syscalls.c', 'src/rtems-bsd-shell.c',
#rtems-bsd-socket.c', 'src/rtems-bsd-syscalls.c',
#rtems-bsd-mbuf.c', #'src/rtems-bsd-socket.c',
'rtems-bsd-malloc.c', #'src/rtems-bsd-mbuf.c',
'rtems-bsd-support.c', 'src/rtems-bsd-malloc.c',
'rtems-bsd-bus-dma.c', 'src/rtems-bsd-support.c',
'rtems-bsd-sysctl.c', 'src/rtems-bsd-bus-dma.c',
'rtems-bsd-sysctlbyname.c', 'src/rtems-bsd-sysctl.c',
'rtems-bsd-sysctlnametomib.c', 'src/rtems-bsd-sysctlbyname.c',
'rtems-bsd-uma.c', 'src/rtems-bsd-sysctlnametomib.c',
'src/rtems-bsd-uma.c',
] ]
# RTEMS files handled separately from modules # RTEMS files handled separately from modules
# rtems = Module('rtems') # rtems = Module('rtems')
@@ -449,6 +452,7 @@ rtems_sourceFiles = [
# rtems.addSourceFiles( rtems_sourceFiles ) # rtems.addSourceFiles( rtems_sourceFiles )
local = Module('local') local = Module('local')
# RTEMS has its own local/pmap.h
local.addHeaderFiles( local.addHeaderFiles(
[ [
'local/bus_if.h', 'local/bus_if.h',
@@ -512,7 +516,6 @@ local.addHeaderFiles(
'local/opt_vlan.h', 'local/opt_vlan.h',
'local/opt_wlan.h', 'local/opt_wlan.h',
'local/opt_zero.h', 'local/opt_zero.h',
'local/pmap.h',
'local/usbdevs_data.h', 'local/usbdevs_data.h',
'local/usbdevs.h', 'local/usbdevs.h',
'local/usb_if.h', 'local/usb_if.h',
@@ -631,7 +634,6 @@ devUsbController.addSourceFiles(
'dev/usb/controller/ohci.c', 'dev/usb/controller/ohci.c',
'dev/usb/controller/ehci.c', 'dev/usb/controller/ehci.c',
'dev/usb/controller/usb_controller.c', 'dev/usb/controller/usb_controller.c',
'dev/usb/controller/ohci_lpc3250.c',
] ]
) )
@@ -1710,6 +1712,7 @@ mm.addModule(devUsbStorage)
# Perform the actual file manipulation # Perform the actual file manipulation
if isForward == True: if isForward == True:
if isOnlyMakefile == False:
mm.copyFiles() mm.copyFiles()
mm.createMakefile() mm.createMakefile()
else: else: