| 1 | #!/usr/bin/perl |
|---|
| 2 | ############################################################################# |
|---|
| 3 | # |
|---|
| 4 | # Copyright (c) 2003-2008, Broadcom Corporation. |
|---|
| 5 | # All rights reserved. |
|---|
| 6 | # Confidential Property of Broadcom Corporation. |
|---|
| 7 | # |
|---|
| 8 | # THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 9 | # AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 10 | # EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 11 | # |
|---|
| 12 | # $brcm_Workfile: bapi_build.pl $ |
|---|
| 13 | # $brcm_Revision: 1 $ |
|---|
| 14 | # $brcm_Date: 3/25/08 10:13a $ |
|---|
| 15 | # |
|---|
| 16 | # File Description: |
|---|
| 17 | # |
|---|
| 18 | # Revision History: |
|---|
| 19 | # |
|---|
| 20 | # $brcm_Log: /BSEAV/api/build/nexus/bapi_build.pl $ |
|---|
| 21 | # |
|---|
| 22 | # 1 3/25/08 10:13a jgarrett |
|---|
| 23 | # PR 40857: Adding shim thunk layer |
|---|
| 24 | # |
|---|
| 25 | ############################################################################# |
|---|
| 26 | use strict; |
|---|
| 27 | |
|---|
| 28 | use bapi_parse_c; |
|---|
| 29 | use bapi_thunks; |
|---|
| 30 | |
|---|
| 31 | my $file; |
|---|
| 32 | my @funcs; |
|---|
| 33 | |
|---|
| 34 | if ($#ARGV == -1) { |
|---|
| 35 | print "You must run autogen to build proxy layer\n"; |
|---|
| 36 | return 1; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | # Process all files on the command line |
|---|
| 40 | for $file (@ARGV) { |
|---|
| 41 | push @funcs, bapi_parse_c::get_func_prototypes $file; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | # Build the perl datastructure |
|---|
| 45 | my @funcrefs = bapi_parse_c::parse_funcs @funcs; |
|---|
| 46 | |
|---|
| 47 | # Print out the perl datastructure |
|---|
| 48 | #bapi_parse_c::print_api @funcrefs; |
|---|
| 49 | |
|---|
| 50 | print "Autogenerating code...\n"; |
|---|
| 51 | |
|---|
| 52 | # Build thunk layer for Settop API |
|---|
| 53 | bapi_thunks::build_thunks "bsettop_autogen_thunks.c", @funcrefs; |
|---|
| 54 | bapi_thunks::build_remapping "bsettop_autogen_thunks.h", @funcrefs; |
|---|
| 55 | |
|---|
| 56 | print "Done\n"; |
|---|