aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Makefile: Don't disable gcc's use-linker-plugin option"Kevin O'Connor2025-04-161-3/+2
| | | | | | | | This reverts commit 8087200ffe2fbbe62265dd480ce8be67db8349eb. The change can break the build on some versions of gcc. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Don't disable gcc's use-linker-plugin optionKevin O'Connor2025-04-161-2/+3
| | | | | | | | | | | | | | | | This option seems to be confusing ld's region usage checks (builds that could fit in small chips are being reported as not fitting). The option was disabled back in commit 4e8674d5 because it showed worse results. However, recent versions of gcc seem to produce the same results even if this option is enabled, so change the build to avoid disabling that option on newer versions of gcc (those that have the -ffat-lto-objects option - which is needed to ensure compile_time_requests sections can be extracted with objcopy). The PRU build is dependent on -fuse-linker-plugin, so enable that option explicitly in its build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* makefile: Replace CFLAGS -I with -iquoteMichael 'ASAP' Weinrich2024-04-031-2/+3
| | | | | | | | | The -iquote tells GCC to only search that path when resolving a quoted "include" (vs <angle brackets>) which by convention imples a include from the projects own soruce tree. This prevents a conflict between Klippers "sched.h" and "gpio.h" and <linux/gpio.h> and glibc <sched.h>. Signed-off-by: Michael 'ASAP' Weinrich <michael@a5ap.net>
* makefile: fix warning about lto serial compilation (#6543)John Unland2024-04-021-1/+1
| | | Signed-off-by: John Unland <junland.foss@gmail.com>
* makefile: disable null pointer checksEric Callahan2022-06-081-1/+1
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* Makefile: Default to python3 for micro-controller build scriptsKevin O'Connor2022-05-131-1/+1
| | | | | | | It's more likely that python3 will be installed than python2 on a typical modern Linux distribution, so use python3 by default. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Improve handling of board symbolic link creationKevin O'Connor2022-02-031-4/+8
| | | | | | | | | Running "make" directly after a "make distclean" can lead to a corrupt out/board symbolic link. Rework the make rules so that the board symbolic link is created in a new make instance that has the updated definition of CONFIG_BOARD_DIRECTORY. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Include debug symbols in the .elfSergey Alirzaev2021-06-081-2/+2
| | | | Signed-off-by: Sergey Alirzaev <zl29ah@gmail.com>
* Makefile: Use CURDIR instead of PWDKevin O'Connor2021-05-191-2/+2
| | | | | | | | Use $(CURDIR) instead of $(PWD) to refer to the current directory, as the PWD variable comes from the shell environment and may not always be set. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Improve build when changing micro-controller architectureKevin O'Connor2020-12-171-18/+23
| | | | | | | | Try to clean up the dependency files when changing the micro-controller architecture so that an explicit "make clean" isn't needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scripts: Convert build from Linux Kconfig to new kconfiglibKevin O'Connor2020-11-231-13/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: fixed missing dependency on autoconf.hBoleslaw Ciesielski2020-06-151-1/+1
| | | | Signed-off-by: Boleslaw Ciesielski <combolek@users.noreply.github.com>
* Makefile: Use "tr -s" in compile_time_request.txt generationKevin O'Connor2019-08-221-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Translate null characters to newline characters in ctr requestsKevin O'Connor2019-08-221-2/+2
| | | | | | | | Store the CTR requests in compile_time_request.txt with the null characters removed. This makes it slightly easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Add generic rule for precompiling linker scriptsKevin O'Connor2019-08-211-0/+4
| | | | | | | Add a general build rule to precompile *.lds.S files to *.ld files. Remove the custom rules in src/atsamd/Makefile and src/stm32/Makefile. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* makefile: Fixed build on OSXLyleCheatham2019-05-201-2/+4
| | | | Signed-off-by: Lyle Cheatham <hello@lylecheatham.com>
* Makefile: Fix lpc176x and stm32f1 buildsKevin O'Connor2019-03-021-2/+4
| | | | | | | | | Commit e18501d0 broke the build for targets that added objects to klipper.elf via adding dependencies. Rework the build so that it is possible to add objects to klipper.elf via a new OBJS_klipper.elf makefile variable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Explicitly list source code in klipper.elf compileKevin O'Connor2019-03-011-2/+2
| | | | | | | Don't use the list of dependencies in the klipper.elf build. This allows the arch makefiles to add separate dependencies to klipper.elf. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scripts: Add a test case for Ubuntu 18.04 compiler errorKevin O'Connor2018-12-221-0/+1
| | | | | | Attempt to detect a bad build of Klipper and report an error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Add gcc option -std=gnu11Kevin O'Connor2018-05-211-1/+1
| | | | | | | Some older versions of gcc require this flag in order to compile the code correctly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Link objects ahead of libraries to avoid failures on some platformsSebastian Meyer2018-02-251-1/+1
| | | | Signed-off-by: Sebastian Meyer <ich@sebmeyer.de>
* build: Add gcc and binutils version to mcu data dictionaryKevin O'Connor2017-12-211-1/+1
| | | | | | | | Store the gcc and binutils versions used in the compilation of the firmware in the firmware data dictionary. Forward that information to the log so it is available during debugging. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Default to python2 in the MakefileKevin O'Connor2017-06-281-1/+1
| | | | | | | Set PYTHON=python2 instead of python as some systems point python to python3. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use compile_time_request system for init, tasks, and shutdownKevin O'Connor2017-05-261-10/+1
| | | | | | | | Avoid using linker magic to define the init, task, and shutdown functions. Instead, use the compile_time_request system. This simplifies the build and produces more efficient code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Avoid linker magic in compile_time_request.c unique id generationKevin O'Connor2017-05-261-9/+12
| | | | | | | | | | | | Avoid generating unique ids via memory locations and linker scripts. Instead, generate them using code produced by buildcommands.py. Utilize gcc's ability to perform static string comparisons at compile time to produce a unique id for each unique string. This fixes a build failure on ARM introduced in 142b92b8. It also reduces the complexity of the build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Add __visible to variables in compile_time_request.cKevin O'Connor2017-05-151-1/+1
| | | | | | | Add __visible to generated code in compile_time_request.c so that the main code can be compiled with -fwhole-program. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Rename makefile CFLAGS-y to CFLAGS and LDFLAGS-y to CFLAGS_klipper.elfKevin O'Connor2017-05-151-9/+7
| | | | | | Rename some makefile variables. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Add workaround to suppress broken avr-gcc "misspelled" warningsKevin O'Connor2017-04-241-1/+1
| | | | | | | Detect avr gcc v4.8.1 and then disable warnings during the klipper.o linking to suppress bogus "misspelled signal handler" warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Define DECL_CONSTANT mechanism for defining exported constantsKevin O'Connor2016-12-231-1/+1
| | | | | | | | | Add a DECL_CONSTANT macro to allow the firmware to define constants that are to be exported to the host during the "identify" phase. This replaces the existing hardcoded mechanism of scanning the Kconfig header file for certain constants. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Disable gcc's use-linker-plugin optionKevin O'Connor2016-12-221-2/+2
| | | | | | | | | On GCC v6 the -fwhole-program option does not take effect when -fuse-linker-plugin is also in effect. The -fuse-linker-plugin option does not optimize as well as -fwhole-program, so explicitly disable the linker plugin via -fno-use-linker-plugin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Be sure to also include out/*.d files in MakefileKevin O'Connor2016-10-211-1/+1
| | | | | | | | | Not including the out/*.d build files can cause the build to be incomplete. In particular, without this fix, if the code is built for ARM and then configured for AVR, the build can produce a corrupt AVR binary. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Support creating and storing the data dictionary on each buildKevin O'Connor2016-09-101-1/+1
| | | | | | | Generate the data dictionary in out/klipper.dict on each build. This makes it easier to use the dictionary when debugging. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Avoid objcopy --dump-section flagKevin O'Connor2016-07-101-1/+1
| | | | | | | | | Commit da305e6b changed the objcopy command to use the --dump-section flag. However, the 2.24 version of avr-objcopy (which is common on raspbian installs) does not support this flag. Avoid using --dump-section and continue to use the -j option instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Update declfuncs.lds.S to only use progmem sections on AVRKevin O'Connor2016-06-141-2/+2
| | | | | | | On non-avr platforms the declfunc stuff still needs to be in the binary in a rodata section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Default to O2 optimizationKevin O'Connor2016-06-141-1/+1
| | | | | | | Default to O2 and set Os in the AVR makefile. Platforms besides AVR are likely to produce better code with O2 so make that the default. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Add Kconfig option to allow boards to disable ADC commandsKevin O'Connor2016-06-131-2/+3
| | | | | | | | Some boards may not support the ADC hardware. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Move listing of directories to create to board makefilesKevin O'Connor2016-06-131-3/+3
| | | | | | Rename DIRS to dirs-y and populate it in the per-board Makefile rules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Create generic board infrastructure and move misc.h to itKevin O'Connor2016-06-131-2/+4
| | | | | | | Instead of creating a misc.h file in each board directory, create a generic board directory and declare misc.h there. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Initial support for Atmel AT90USB1286 mcuKevin O'Connor2016-06-051-1/+1
| | | | | | | Add GPIO definitions for the AT90USB1286. Add code for communicating over USB port on AT90USB1286. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+123
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>