Advertisement
Guest User

CSMG Sarma

a guest
Apr 16th, 2010
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.18 KB | None | 0 0
  1. HEX = main.hex
  2.  
  3. TAR=debug
  4.  
  5. DEV=/home/sarma/intrests/arm/arm\ test\ suite/dev
  6.  
  7.  
  8. INCL=$(DEV)/inc
  9. # preprocessor headers
  10.  
  11. SRC=$(DEV)/src
  12. # source file directory
  13.  
  14. LNK= $(OBJPATH)/tnkernel_startup_gcc.o\
  15.     $(OBJPATH)/startup_hardware_init.o
  16. # Startup modules to belinked
  17.  
  18. LS = $(DEV)/startup/lpc2148_gcc.ld
  19. # linker script
  20.  
  21. OBJPATH=$(DEV)/obj
  22.  
  23. #debug.c is in PWD the rest are in $(SRC)/$(shell basename <object_module> .o)/ location.
  24. OBJ =   debug.o\
  25.     sw_delay.o\
  26.     led.o\
  27.     lcd.o\
  28.     buzzer.o
  29.  
  30. GCCFLAGS = -I $(INCL)
  31.  
  32. %.o:$(SRC)/$(shell basename .o)/$(shell basename %.c)
  33.     arm-elf-gcc  -mcpu=arm7tdmi -mlittle-endian -Wall -O0 -gdwarf-2 -std=c99 -march=armv4t -mlittle-endian -fno-builtin $(GCCFLAGS) -c $<
  34.  
  35. $(HEX):$(HEX:.hex=.c) $(OBJ)
  36.      arm-elf-gcc  -mcpu=arm7tdmi -mlittle-endian -Wall -O0 -gdwarf-2 -std=c99 -march=armv4t -mlittle-endian -fno-builtin  -nostartfiles -Wl,-Map=$(HEX:.hex=.map),--cref -lc  -lm -lc -lgcc -T $(LS)   $(HEX:.hex=.c)  $(OBJ) -o $(HEX:.hex=.o) $(GCCFLAGS) $(LNK)
  37.     arm-elf-objcopy -I ihex $(HEX:.hex=.o) $(HEX)
  38.  
  39.  
  40. hex:
  41.     mv $(TAR).o $(OBJPATH)
  42.     cp $(HEX) /tmp/
  43.  
  44. clean: hex
  45.     rm -f $(HEX:.hex=.o)
  46.     rm -f *.map
  47.     rm -f *~
  48.  
  49. distclean:clean
  50.     rm -f *.hex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement