Browse files

cleanup the Makefile

  • Loading branch information...
1 parent 2af5da9 commit f2c5182094ad26b052b5a561a8cd2cb7c937cfa7 Xiangfu Liu committed Jul 28, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/Makefile
@@ -1,18 +1,25 @@
include $(MMDIR)/software/include.mak
-OBJECTS=crt0.o main.o tests_sdram.o tests_gpio.o tests_vga.o tests_memorycard.o tests_audio.o tests_ethernet.o tests_videoin.o tests_midi.o tests_dmx.o tests_ir.o tests_usb.o
-SEGMENTS=-j .text -j .data -j .rodata
+SRCS = $(wildcard *.c)
+COBJS = $(SRCS:.c=.o)
+OBJECTS = crt0.o $(COBJS)
+SEGMENTS= -j .text -j .data -j .rodata
+LDFLAGS+= -T linker.ld -N
+LDFLAGS+= -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libmath -L$(MMDIR)/software/libnet -L$(MMDIR)/software/libhal
+LIBS = -lbase -lmath -lnet -lhal -lbase
all: boot.bin
%.bin: %.elf
- $(MAKE) -C $(MMDIR)/tools
$(OBJCOPY) $(SEGMENTS) -O binary $< $@
chmod -x $@
+ $(MAKE) -C $(MMDIR)/tools
$(MMDIR)/tools/mkmmimg $@
boot.elf: linker.ld $(OBJECTS)
- $(LD) $(LDFLAGS) -T linker.ld -N -o $@ -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libmath -L$(MMDIR)/software/libnet -L$(MMDIR)/software/libhal $(OBJECTS) -lbase -lmath -lnet -lhal -lbase
+ $(LD) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
chmod -x $@
load: boot.bin

0 comments on commit f2c5182

Please sign in to comment.