Changed the generation of symbols to the mknmlist script. Now symbols.h is not automatically generated so we can use it as a normal include file and remove symbols-def.h.

This commit is contained in:
adamdunkels 2007-01-24 16:11:48 +00:00
parent bea6aa5b3d
commit 83b348631f
6 changed files with 57 additions and 10 deletions

45
core/loader/symbols.h Normal file
View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 2005, Swedish Institute of Computer Science
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: symbols.h,v 1.4 2007/01/24 16:13:49 adamdunkels Exp $
*/
#ifndef __SYMBOLS_DEF_H__
#define __SYMBOLS_DEF_H__
struct symbols {
const char *name;
const char *value;
};
extern const int symbols_nelts;
extern const struct symbols symbols[];
#endif /* __SYMBOLS_DEF_H__ */

View file

@ -28,14 +28,14 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: symtab-avr.c,v 1.2 2007/01/23 12:31:14 bg- Exp $
* @(#)$Id: symtab-avr.c,v 1.3 2007/01/24 16:13:50 adamdunkels Exp $
*/
#include <stdio.h>
#include <string.h>
#include <avr/pgmspace.h>
#include "symtab.h"
#include "loader/symbols-def.h"
#include "loader/symbols.h"
#define SYMTAB_CONF_BINARY_SEARCH 0

View file

@ -28,12 +28,12 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: symtab.c,v 1.6 2007/01/12 13:55:05 bg- Exp $
* @(#)$Id: symtab.c,v 1.7 2007/01/24 16:13:50 adamdunkels Exp $
*/
#include "symtab.h"
#include "loader/symbols-def.h"
#include "loader/symbols.h"
#include <string.h>

View file

@ -1,4 +1,4 @@
# $Id: Makefile.msp430,v 1.10 2006/12/19 09:22:25 adamdunkels Exp $
# $Id: Makefile.msp430,v 1.11 2007/01/24 16:13:47 adamdunkels Exp $
### Check if we are running under Windows
@ -40,7 +40,7 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
### Compiler definitions
CC = msp430-gcc
LD = msp430-ld
LD = msp430-gcc
AS = msp430-as
AR = msp430-ar
OBJCOPY = msp430-objcopy
@ -103,8 +103,9 @@ loader-init.o: ${CONTIKI_TARGET}/loader/loader-init.S
.PHONY: symbols.c symbols.h
ifdef CORE
symbols.c symbols.h:
@${CONTIKI}/tools/msp430-make-symbols $(CORE)
symbols.c:
# @${CONTIKI}/tools/msp430-make-symbols $(CORE)
$(NM) $(CORE) | awk -f ../../tools/mknmlist > symbols.c
else
symbols.c symbols.h:
@${CONTIKI}/tools/make-empty-symbols

View file

@ -1,5 +1,6 @@
#!/bin/sh
echo "#include \"symbols.h\"" > symbols.c
echo "const int symbols_nelts = 0;" >> symbols.c
echo "const struct symbols symbols[] = {{0,0}};" >> symbols.c
echo "#include \"loader/symbols-def.h\"" > symbols.h
echo "#include \"loader/symbols.h\"" > symbols.h
echo "extern const struct symbols symbols[1];">> symbols.h

View file

@ -30,7 +30,7 @@ BEGIN {
END {
sort(name, nname);
print "#include \"loader/symbols-def.h\"\n";
print "#include \"loader/symbols.h\"\n";
# Must deal with compiler builtins etc.
for (x = 0; x < nname; x++) {