|
| 1 | +############################################################################## |
| 2 | +# # |
| 3 | +# BeBoPr - 3D printer software for Linux on BeagleBone # |
| 4 | +# # |
| 5 | +# 2012-05-29 - ARM version for BeagleBone with BeBoPr cape # |
| 6 | +# # |
| 7 | +# Copyright (C) 2011-2012 Bas Laarhoven aka modmaker # |
| 8 | +# # |
| 9 | +# Partly based on code by Triffid Hunter, Traumflug, jakepoz, Markus Hitter, # |
| 10 | +# and many others. # |
| 11 | +# Previous Copyright: (C) 2009-2010 Michael Moon aka Triffid_Hunter # |
| 12 | +# # |
| 13 | +# This program is free software; you can redistribute it and/or modify # |
| 14 | +# it under the terms of the GNU General Public License as published by # |
| 15 | +# the Free Software Foundation; either version 2 of the License, or # |
| 16 | +# (at your option) any later version. # |
| 17 | +# # |
| 18 | +# This program is distributed in the hope that it will be useful, # |
| 19 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 20 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 21 | +# GNU General Public License for more details. # |
| 22 | +# # |
| 23 | +# You should have received a copy of the GNU General Public License # |
| 24 | +# along with this program; if not, write to the Free Software # |
| 25 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # |
| 26 | +# # |
| 27 | +############################################################################## |
| 28 | + |
| 29 | +############################################################################## |
| 30 | +# # |
| 31 | +# These defaults should be ok, change if you need to # |
| 32 | +# # |
| 33 | +############################################################################## |
| 34 | + |
| 35 | +# Name of this Makefile (used for "make depend"). |
| 36 | + |
| 37 | +DEFS= |
| 38 | + |
| 39 | +#PATH=/home/bas/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/bin:$(PATH) |
| 40 | +ARCH=arm |
| 41 | +CROSS_COMPILE=arm-arago-linux-gnueabi- |
| 42 | + |
| 43 | +MAKEFILE = Makefile |
| 44 | + |
| 45 | +CSTD=gnu99 |
| 46 | + |
| 47 | +PROGRAM = mendel |
| 48 | + |
| 49 | +SOURCES = \ |
| 50 | + analog.c \ |
| 51 | + beaglebone-stubs.c \ |
| 52 | + bebopr_r2.c \ |
| 53 | + clock.c \ |
| 54 | + dda.c \ |
| 55 | + dda_queue.c \ |
| 56 | + dda_util.c \ |
| 57 | + debug.c \ |
| 58 | + gcode_parse.c \ |
| 59 | + gcode_process.c \ |
| 60 | + gpio.c \ |
| 61 | + heater.c \ |
| 62 | + home.c \ |
| 63 | + limit_switches.c \ |
| 64 | + pinio.c \ |
| 65 | + pruss.c \ |
| 66 | + pwm.c \ |
| 67 | + serial.c \ |
| 68 | + sermsg.c \ |
| 69 | + sersendf.c \ |
| 70 | + temp.c \ |
| 71 | + thermistor.c \ |
| 72 | + timer.c \ |
| 73 | + traject.c \ |
| 74 | + $(PROGRAM).c |
| 75 | + |
| 76 | +CC = $(CROSS_COMPILE)gcc |
| 77 | +OBJDUMP = $(CROSS_COMPILE)objdump |
| 78 | +OBJCOPY = $(CROSS_COMPILE)objcopy |
| 79 | + |
| 80 | +#OPTIMIZE = -Os -ffunction-sections -finline-functions-called-once -mcall-prologues |
| 81 | +# OPTIMIZE = -O0 |
| 82 | +CFLAGS = -g -Wall -Wstrict-prototypes $(OPTIMIZE) $(DEFS) -std=${CSTD} -funsigned-char -funsigned-bitfields -fpack-struct -save-temps -pthread |
| 83 | +LDFLAGS = -Wl,--as-needed -Wl,--gc-sections |
| 84 | +LIBS = -lm -pthread -lrt |
| 85 | +LIBDEPS = |
| 86 | + |
| 87 | +SUBDIRS = |
| 88 | + |
| 89 | +OBJ = $(patsubst %.c,%.o,${SOURCES}) |
| 90 | + |
| 91 | +.PHONY: all program clean subdirs doc |
| 92 | +.PRECIOUS: %.o %.elf |
| 93 | + |
| 94 | +all: config.h $(PROGRAM).elf |
| 95 | + |
| 96 | +$(PROGRAM).elf: $(LIBDEPS) |
| 97 | + |
| 98 | +subdirs: |
| 99 | + @for dir in $(SUBDIRS); do \ |
| 100 | + $(MAKE) -C $$dir; \ |
| 101 | + done |
| 102 | + |
| 103 | +clean: clean-subdirs |
| 104 | + -rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al *.i *.s *~ *fuse |
| 105 | + |
| 106 | +clean-subdirs: |
| 107 | + @for dir in $(SUBDIRS); do \ |
| 108 | + $(MAKE) -C $$dir clean; \ |
| 109 | + done |
| 110 | + |
| 111 | +doc: Doxyfile *.c *.h |
| 112 | + doxygen $< |
| 113 | + |
| 114 | +%.o: %.c config.h Makefile |
| 115 | + @echo " CC $@" |
| 116 | + @$(CC) -c $(CFLAGS) -Wa,-adhlns=$(<:.c=.al) -o $@ $(subst .o,.c,$@) |
| 117 | + |
| 118 | +%.elf: $(OBJ) |
| 119 | + @echo " LINK $@" |
| 120 | + @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 121 | + |
| 122 | +%.lst: %.elf |
| 123 | + @echo " OBJDUMP $@" |
| 124 | + @$(OBJDUMP) -h -S $< > $@ |
| 125 | + |
| 126 | +depend: |
| 127 | + @echo " Appending dependancy information to '$(MAKEFILE)'" |
| 128 | + @if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; then \ |
| 129 | + sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > $(MAKEFILE).$$$$ && \ |
| 130 | + mv -f $(MAKEFILE).$$$$ $(MAKEFILE); \ |
| 131 | + fi; \ |
| 132 | + echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> $(MAKEFILE) ; \ |
| 133 | + if [ "$(MCU_TARGET)x"=="x" ] ; then \ |
| 134 | + $(CC) -MM $(CDEFS) $(CINCS) $(SOURCES) $(ASRC) >> $(MAKEFILE) ; \ |
| 135 | + else \ |
| 136 | + $(CC) -MM -mmcu=$(MCU_TARGET) $(CDEFS) $(CINCS) $(SOURCES) $(ASRC) >> $(MAKEFILE) ; \ |
| 137 | + fi |
| 138 | + |
| 139 | +install: |
| 140 | + @echo " INSTALLING '$(PROGRAM)' TO '$(TARGET_NFS_ROOT)'" |
| 141 | + @if [ -n "$(TARGET_NFS_ROOT)" ] ; then \ |
| 142 | + sudo cp $(PROGRAM).elf $(TARGET_NFS_ROOT)/home/root/ ; \ |
| 143 | + else \ |
| 144 | + echo "INSTALL: no destination specified" ; \ |
| 145 | + fi |
| 146 | + |
| 147 | +.PHONY: all build elf hex eep lss sym program coff extcoff clean depend applet_files install |
| 148 | + |
| 149 | +# DO NOT DELETE THIS LINE -- make depend depends on it. |
| 150 | +analog.o: analog.c analog.h beaglebone.h mendel.h debug.h |
| 151 | +beaglebone-stubs.o: beaglebone-stubs.c beaglebone.h beaglebone-stubs.h |
| 152 | +bebopr_r2.o: bebopr_r2.c analog.h temp.h beaglebone.h thermistor.h \ |
| 153 | + bebopr.h heater.h pwm.h |
| 154 | +clock.o: clock.c clock.h pinio.h config.h config_macros.h prusa_mech.h \ |
| 155 | + wades_extruder.h sersendf.h dda_queue.h dda.h timer.h temp.h analog.h \ |
| 156 | + debug.h heater.h pwm.h serial.h beaglebone-stubs.h memory_barrier.h \ |
| 157 | + gcode_process.h gcode_parse.h |
| 158 | +dda.o: dda.c pruss.h algo2cmds.h dda.h config.h config_macros.h \ |
| 159 | + prusa_mech.h wades_extruder.h timer.h serial.h beaglebone-stubs.h \ |
| 160 | + sermsg.h gcode_parse.h dda_queue.h debug.h sersendf.h pinio.h \ |
| 161 | + memory_barrier.h dda_util.h |
| 162 | +dda_queue.o: dda_queue.c dda_queue.h dda.h config.h config_macros.h \ |
| 163 | + prusa_mech.h wades_extruder.h timer.h serial.h beaglebone-stubs.h \ |
| 164 | + sermsg.h temp.h analog.h sersendf.h clock.h memory_barrier.h pruss.h \ |
| 165 | + algo2cmds.h |
| 166 | +dda_util.o: dda_util.c dda_util.h |
| 167 | +debug.o: debug.c debug.h config.h config_macros.h prusa_mech.h \ |
| 168 | + wades_extruder.h |
| 169 | +gcode_parse.o: gcode_parse.c gcode_parse.h dda.h config.h config_macros.h \ |
| 170 | + prusa_mech.h wades_extruder.h serial.h beaglebone-stubs.h sermsg.h \ |
| 171 | + debug.h heater.h temp.h analog.h pwm.h sersendf.h gcode_process.h |
| 172 | +gcode_process.o: gcode_process.c gcode_process.h gcode_parse.h dda.h \ |
| 173 | + config.h config_macros.h prusa_mech.h wades_extruder.h dda_queue.h \ |
| 174 | + timer.h serial.h beaglebone-stubs.h sermsg.h temp.h analog.h heater.h \ |
| 175 | + pwm.h sersendf.h pinio.h debug.h clock.h home.h traject.h pruss.h \ |
| 176 | + algo2cmds.h |
| 177 | +gpio.o: gpio.c gpio.h |
| 178 | +heater.o: heater.c heater.h temp.h analog.h pwm.h debug.h beaglebone.h \ |
| 179 | + mendel.h |
| 180 | +home.o: home.c pruss.h algo2cmds.h limit_switches.h home.h dda_queue.h \ |
| 181 | + dda.h config.h config_macros.h prusa_mech.h wades_extruder.h timer.h \ |
| 182 | + pinio.h sersendf.h memory_barrier.h debug.h gcode_process.h \ |
| 183 | + gcode_parse.h traject.h bebopr.h |
| 184 | +limit_switches.o: limit_switches.c limit_switches.h pruss.h algo2cmds.h \ |
| 185 | + mendel.h bebopr.h gpio.h |
| 186 | +pinio.o: pinio.c pinio.h config.h config_macros.h prusa_mech.h \ |
| 187 | + wades_extruder.h |
| 188 | +pruss.o: pruss.c pruss.h algo2cmds.h beaglebone.h |
| 189 | +pwm.o: pwm.c pwm.h |
| 190 | +serial.o: serial.c serial.h beaglebone-stubs.h mendel.h |
| 191 | +sermsg.o: sermsg.c sermsg.h serial.h beaglebone-stubs.h |
| 192 | +sersendf.o: sersendf.c sersendf.h serial.h beaglebone-stubs.h sermsg.h |
| 193 | +temp.o: temp.c temp.h analog.h beaglebone.h debug.h |
| 194 | +thermistor.o: thermistor.c beaglebone.h thermistor.h |
| 195 | +timer.o: timer.c timer.h platform.h beaglebone.h config.h config_macros.h \ |
| 196 | + prusa_mech.h wades_extruder.h dda_queue.h dda.h memory_barrier.h |
| 197 | +traject.o: traject.c traject.h pruss.h algo2cmds.h debug.h |
| 198 | +mendel.o: mendel.c config.h config_macros.h prusa_mech.h wades_extruder.h \ |
| 199 | + serial.h beaglebone-stubs.h dda_queue.h dda.h timer.h gcode_parse.h \ |
| 200 | + temp.h analog.h sermsg.h debug.h sersendf.h heater.h pwm.h pinio.h \ |
| 201 | + platform.h beaglebone.h clock.h bebopr.h mendel.h gcode_process.h \ |
| 202 | + limit_switches.h |
0 commit comments