This makefile seems to do better.

This commit is contained in:
Mariano Alvira 2009-04-15 13:40:21 -04:00
parent 02dfccee44
commit d75d9d98f5
2 changed files with 16 additions and 10 deletions

View File

@ -46,7 +46,7 @@ AOBJS =
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
TESTS = $(wildcard tests/*.c)
TARGETS = $(patsubst %.c,%.o,$(TESTS))
#TARGETS = tests/blink-white.o
# Add GCC lib
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
@ -54,11 +54,11 @@ PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-l
#########################################################################
#ALL = blink.srec blink.bin blink.dis blink.System.map
ALL = $(TARGETS) $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis)
ALL = $(TESTS:.c=.srec) $(TESTS:.c=.bin) $(TESTS:.c=.dis)
.PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj)
all: $(COBJS) $(ALL)
all: $(ALL)
%.srec: %.obj
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
@ -73,9 +73,9 @@ all: $(COBJS) $(ALL)
$(OBJDUMP) -DS $< > $@
%.obj: $(AOBJS) $(COBJS) $(TARGETS) $(LDSCRIPT)
$(LD) $(LDFLAGS) $(AOBJS) $(COBJS) \
$(LD) $(LDFLAGS) $(AOBJS) \
--start-group $(PLATFORM_LIBS) --end-group \
-Map $*.map $*.o -o $@
-Map $*.map $*.o $< -o $@
%.System.map: %.obj

View File

@ -31,7 +31,7 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7',
__attribute__ ((section ("startup")))
void main(void) {
uint8_t c;
nvmType_t type;
uint32_t type;
nvmErr_t err;
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100;
@ -53,14 +53,20 @@ void main(void) {
reg(UART1_CON) = 0x00000003; /* enable receive and transmit */
reg(GPIO_FUNC_SEL0) = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/
vreg_init();
puts("CRM status: 0x");
put_hex32(reg(0x80003018));
puts("\n\r");
puts("Detecting internal nvm\n\r");
err = nvm_detect(gNvmInternalInterface_c, &type);
puts("nvm_detect returned: ");
putc(err);
puts(" type is: ");
putc(type);
puts("nvm_detect returned: 0x");
put_hex(err);
puts(" type is: 0x");
put_hex(type);
puts("\n\r");
while(1) {