This makefile seems to do better.
This commit is contained in:
parent
02dfccee44
commit
d75d9d98f5
10
Makefile
10
Makefile
|
@ -46,7 +46,7 @@ AOBJS =
|
||||||
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
|
COBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
|
||||||
TESTS = $(wildcard tests/*.c)
|
TESTS = $(wildcard tests/*.c)
|
||||||
TARGETS = $(patsubst %.c,%.o,$(TESTS))
|
TARGETS = $(patsubst %.c,%.o,$(TESTS))
|
||||||
|
#TARGETS = tests/blink-white.o
|
||||||
|
|
||||||
# Add GCC lib
|
# Add GCC lib
|
||||||
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
|
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 = 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)
|
.PRECIOUS: $(COBJS) $(TARGETS) $(TESTS:.c=.obj)
|
||||||
|
|
||||||
all: $(COBJS) $(ALL)
|
all: $(ALL)
|
||||||
|
|
||||||
%.srec: %.obj
|
%.srec: %.obj
|
||||||
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
|
||||||
|
@ -73,9 +73,9 @@ all: $(COBJS) $(ALL)
|
||||||
$(OBJDUMP) -DS $< > $@
|
$(OBJDUMP) -DS $< > $@
|
||||||
|
|
||||||
%.obj: $(AOBJS) $(COBJS) $(TARGETS) $(LDSCRIPT)
|
%.obj: $(AOBJS) $(COBJS) $(TARGETS) $(LDSCRIPT)
|
||||||
$(LD) $(LDFLAGS) $(AOBJS) $(COBJS) \
|
$(LD) $(LDFLAGS) $(AOBJS) \
|
||||||
--start-group $(PLATFORM_LIBS) --end-group \
|
--start-group $(PLATFORM_LIBS) --end-group \
|
||||||
-Map $*.map $*.o -o $@
|
-Map $*.map $*.o $< -o $@
|
||||||
|
|
||||||
|
|
||||||
%.System.map: %.obj
|
%.System.map: %.obj
|
||||||
|
|
|
@ -31,7 +31,7 @@ const uint8_t hex[16]={'0','1','2','3','4','5','6','7',
|
||||||
__attribute__ ((section ("startup")))
|
__attribute__ ((section ("startup")))
|
||||||
void main(void) {
|
void main(void) {
|
||||||
uint8_t c;
|
uint8_t c;
|
||||||
nvmType_t type;
|
uint32_t type;
|
||||||
nvmErr_t err;
|
nvmErr_t err;
|
||||||
|
|
||||||
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100;
|
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000100;
|
||||||
|
@ -53,14 +53,20 @@ void main(void) {
|
||||||
reg(UART1_CON) = 0x00000003; /* enable receive and transmit */
|
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)*/
|
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");
|
puts("Detecting internal nvm\n\r");
|
||||||
|
|
||||||
err = nvm_detect(gNvmInternalInterface_c, &type);
|
err = nvm_detect(gNvmInternalInterface_c, &type);
|
||||||
|
|
||||||
puts("nvm_detect returned: ");
|
puts("nvm_detect returned: 0x");
|
||||||
putc(err);
|
put_hex(err);
|
||||||
puts(" type is: ");
|
puts(" type is: 0x");
|
||||||
putc(type);
|
put_hex(type);
|
||||||
puts("\n\r");
|
puts("\n\r");
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
Loading…
Reference in a new issue