rearrange Makefile, hopefully easier to access tunables for first-timers

This commit is contained in:
Michael Moon 2010-11-08 18:39:15 +11:00
parent 41f68be450
commit a4b0c2f848
1 changed files with 34 additions and 27 deletions

View File

@ -23,39 +23,19 @@
# #
##############################################################################
##############################################################################
# #
# Change these to suit your application #
# #
##############################################################################
PROGRAM = mendel
SOURCES = $(PROGRAM).c serial.c dda.c gcode_parse.c gcode_process.c timer.c temp.c sermsg.c dda_queue.c watchdog.c debug.c sersendf.c heater.c analog.c delay.c intercom.c pinio.c
##############################################################################
# #
# Change these to suit your hardware #
# #
##############################################################################
#MCU_TARGET = atmega168
# MCU_TARGET = atmega168
# MCU_TARGET = atmega328p
MCU_TARGET = atmega644p
#MCU_TARGET = atmega1280
# MCU_TARGET = atmega1280
F_CPU = 16000000L
##############################################################################
# #
# These defaults should be ok, change if you need to #
# #
##############################################################################
ARCH = avr-
CC = $(ARCH)gcc
OBJDUMP = $(ARCH)objdump
OBJCOPY = $(ARCH)objcopy
##############################################################################
# #
# Available Defines: #
@ -70,16 +50,20 @@ OBJCOPY = $(ARCH)objcopy
# enables start/stop ramping #
# GEN3 #
# build for standard reprap electronics instead of your custom rig #
# HOST #
# this is the motherboard for GEN3- don't touch! Extruder has its own #
# Makefile. #
# #
##############################################################################
DEFS = -DF_CPU=$(F_CPU) -DHOST -DGEN3
# DEFS += "-DDEBUG=1"
OPTIMIZE = -Os -ffunction-sections -finline-functions-called-once -mcall-prologues
# OPTIMIZE = -O0
CFLAGS = -g -Wall -Wstrict-prototypes $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS) -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -save-temps
LDFLAGS = -Wl,--as-needed -Wl,--gc-sections
##############################################################################
# #
# Programmer settings for "make program" #
# #
##############################################################################
AVRDUDE = avrdude
AVRDUDECONF = /etc/avrdude.conf
@ -92,12 +76,35 @@ AVRDUDECONF = /etc/avrdude.conf
# MODE="0660" #
# #
##############################################################################
PROGPORT = /dev/arduino
# atmega168
#PROGBAUD = 19200
# atmega328p, 644p, 1280
PROGBAUD = 57600
##############################################################################
# #
# These defaults should be ok, change if you need to #
# #
##############################################################################
PROGRAM = mendel
SOURCES = $(PROGRAM).c serial.c dda.c gcode_parse.c gcode_process.c timer.c temp.c sermsg.c dda_queue.c watchdog.c debug.c sersendf.c heater.c analog.c delay.c intercom.c pinio.c
ARCH = avr-
CC = $(ARCH)gcc
OBJDUMP = $(ARCH)objdump
OBJCOPY = $(ARCH)objcopy
OPTIMIZE = -Os -ffunction-sections -finline-functions-called-once -mcall-prologues
# OPTIMIZE = -O0
CFLAGS = -g -Wall -Wstrict-prototypes $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS) -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -save-temps
LDFLAGS = -Wl,--as-needed -Wl,--gc-sections
OBJ = $(patsubst %.c,%.o,${SOURCES})
.PHONY: all program clean size