Guest User

Untitled

a guest
Jul 21st, 2011
590
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export PATH := $(PATH):/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-tools/bin/
  2.  
  3. F_CPU=72000000L
  4. #F_CPU=96000000L
  5.  
  6. # normal baudrate for ftdi comm at 72mhz = 1500000
  7.  
  8. DEFINES=-DBAUDRATE=230400 -D__C32__
  9.  
  10. TARGET=main
  11.  
  12. AS=pic32-as
  13. CC=pic32-gcc
  14. CXX=pic32-g++
  15. LD=pic32-ld
  16. OBJDUMP=pic32-objdump
  17. OBJCOPY=pic32-objcopy
  18. BIN2HEX=pic32-bin2hex
  19. SIZE=pic32-size
  20.  
  21. LDSCRIPT=/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/cores/pic32/chipKIT-MAX32-application-32MX795F512L.ld
  22.  
  23. AVRDUDE=/Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude
  24.  
  25. CBASE=-O2 -fno-exceptions -mno-smart-io -mprocessor=32MX795F512L -DF_CPU=$(F_CPU) -D_BOARD_MEGA_ $(DEFINES)
  26.  
  27. CFLAGS=$(WARNINGSC) $(CBASE) $(INCLUDE)
  28. CXXFLAGS=$(WARNINGSCXX) $(CBASE) $(INCLUDE) -fno-exceptions -fno-rtti
  29. ASFLAGS=-save-temps
  30.  
  31. LINKER_FLAGS=-Xlinker -T$(LDSCRIPT) -Xlinker -o$(OUTPUT).elf -Xlinker -M -Xlinker -Map=$(OUTPUT).map
  32.  
  33. INCLUDES=/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/cores/pic32 source source/wiring source/USB
  34. SOURCES = source source/wiring source/USB crt0
  35.  
  36. BUILD   = build
  37.  
  38. ifneq ($(BUILD),$(notdir $(CURDIR)))
  39.  
  40. export LDSCRIPT=$(CURDIR)/lpc2104-rom2.ld
  41. export MAKEFILE = $(CURDIR)/Makefile
  42.  
  43. export INCLUDE = $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
  44.     $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
  45.     -I$(CURDIR)/$(BUILD)
  46.  
  47. export OUTPUT   :=  $(CURDIR)/$(TARGET)
  48. export VPATH    :=  $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
  49.             $(foreach dir,$(DATA),$(CURDIR)/$(dir))
  50. export DEPSDIR  :=  $(CURDIR)/$(BUILD)
  51.  
  52. #export CRT0=/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/cores/pic32/*.S
  53. #export CRT0=source/wiring/*.S
  54.  
  55. export CFILES   = $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
  56. export SFILES   = $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
  57. export CPPFILES = $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
  58. export AUTOSRC = $(AUTOC) $(AUTOCPP)
  59.  
  60. export THUMB_SRC = $(AUTOSRC)
  61.  
  62. export OFILES   := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.S=.o)
  63.  
  64. .PHONY: $(BUILD) clean
  65.  
  66. #---------------------------------------------------------------------------------
  67. $(BUILD):
  68.     @[ -d $@ ] || mkdir -p $@
  69.     @#@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
  70.     @make -C $(BUILD) -f $(MAKEFILE)
  71.  
  72. all:    $(BUILD)
  73.  
  74. clean:
  75.     rm -rf $(BUILD) $(TARGET).elf $(TARGET).{hex,map,elf} html
  76.  
  77. burn:   $(BUILD)
  78.     $(AVRDUDE) -C/Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -q -q -p32MX795F512L -cstk500v2 -P/dev/tty.usbserial-A5004H5Q -b115200 -D -Uflash:w:$(OUTPUT).hex:i
  79.  
  80. else
  81.  
  82. DEPENDS :=  $(OFILES:.o=.d)
  83.  
  84. $(OUTPUT).hex:  $(OUTPUT).elf
  85.  
  86. $(OUTPUT).elf:  $(OFILES)
  87.  
  88. -include $(DEPENDS)
  89.  
  90. endif
  91.  
  92. $(OUTPUT).hex:  $(OUTPUT).elf
  93.     $(OBJCOPY) $(OUTPUT).elf -O ihex $(OUTPUT).hex
  94.  
  95. $(OUTPUT).elf:  $(OFILES) $(CRT0) $(MAKEFILE)
  96.     $(CXX) $(OFILES) -Wl,--gc-sections -mprocessor=32MX795F512L $(LINKER_FLAGS)
  97.  
  98. %.o:    %.c
  99.     @echo $(notdir $<)
  100.     $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×