IDE compiling from source

Trying to build the IDE on Eclipse but all I could find on the subject was either obscure or completely outdated. Some help or a point to somewhere with instructions that can be understood would be just great.

Thanks!

You can download it already compiled from here. Sorry, I don't have much help on compiling it yourself.

Is there a reason you need to do this?

Yea I want to try my own ideas on the IDE and it needs to be recompiled from the source so...

Displacer:
Trying to build the IDE on Eclipse but all I could find on the subject was either obscure or completely outdated. Some help or a point to somewhere with instructions that can be understood would be just great.

Thanks!

I would suggest using a plain old text editor with a Makefile.

Here’s a “generic” Makefile that I use. The top few entries need to be edited depending on the AVR chip you are using. Also, you may need to add some path strings to the AVR toolchain stuff if yours isn’t already in the executable path.

I run it in Linux… the Makefile SHOULD also work in Windoze and Mac, but I’m not sure.

You will, of course, also need the “Make” utility. Try it, you may like it.

## project specific
PART = attiny85 #must be a valid AVR part
F_CPU = 16000000UL
TARGET = source_file_name  #i.e. for "newcode.cpp", use "newcode"
FORMAT = ihex
OPT = O3

## fuse settings - you MUST set these properly for your particular AVR and project
LFUSE  = 0xF7
HFUSE  = 0xDC
EFUSE  = 0xFF
UNLOCK = 0xFF
LOCK   = 0xFC

################### no changes beyond this point ################

CPPFLAGS  = -Wall
CPPFLAGS += -Wchar-subscripts
CPPFLAGS += -Wcomment
CPPFLAGS += -Wdouble-promotion
CPPFLAGS += -Weffc++
CPPFLAGS += -Wextra
CPPFLAGS += -Wfloat-equal
CPPFLAGS += -Wformat
CPPFLAGS += -Wlong-long
CPPFLAGS += -Wparentheses
CPPFLAGS += -Wpedantic
CPPFLAGS += -Wpointer-arith
CPPFLAGS += -Wreturn-type
CPPFLAGS += -Wsign-compare
CPPFLAGS += -Wstack-protector
CPPFLAGS += -Wswitch
CPPFLAGS += -Wswitch-default
CPPFLAGS += -Wswitch-enum
CPPFLAGS += -Wtrigraphs
CPPFLAGS += -Wuninitialized
CPPFLAGS += -Wunreachable-code
CPPFLAGS += -Wunsafe-loop-optimizations
CPPFLAGS += -Wunused
CPPFLAGS += -Wunused-function
CPPFLAGS += -Wunused-label
CPPFLAGS += -Wunused-parameter
CPPFLAGS += -Wunused-value
CPPFLAGS += -Wunused-variable
CPPFLAGS += -Wvolatile-register-var
CPPFLAGS += -ffunction-sections
CPPFLAGS += -fdata-sections
CPPFLAGS += -fno-exceptions
CPPFLAGS += -c
CPPFLAGS += -g
CPPFLAGS += -$(OPT)
CPPFLAGS += -mmcu=$(PART)
CPPFLAGS += -DF_CPU=$(F_CPU)

LINKFLAGS  = -$(OPT)
LINKFLAGS += -mmcu=$(PART)
LINKFLAGS += -Wl,--gc-sections
LINKFLAGS += -lm

AVRDUDE_CMD = $(AVRDUDE)
AVRDUDE_CMD += -p $(PART)
AVRDUDE_CMD += -b 115200
AVRDUDE_CMD += -c avrispmkii
AVRDUDE_CMD += -P usb
AVRDUDE_CMD += -e
AVRDUDE_CMD += -s
AVRDUDE_CMD += -qq
AVRDUDE_CMD += -U lock:w:$(UNLOCK):m
AVRDUDE_CMD += -U lfuse:w:$(LFUSE):m
AVRDUDE_CMD += -U hfuse:w:$(HFUSE):m
AVRDUDE_CMD += -U efuse:w:$(EFUSE):m
AVRDUDE_CMD += -U flash:w:$(TARGET).hex:i
AVRDUDE_CMD += -U eeprom:w:$(TARGET).eep:i
AVRDUDE_CMD += -U lock:w:$(LOCK):m

CC = avr-gcc
CXX = avr-g++
LD = avr-ld
AR = avr-ar
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
NM = avr-nm
AVRSTRIP = avr-strip
AVRSIZE = avr-size
AVRDUDE = avrdude

# default rule
.DEFAULT_GOAL = target

#_______________________________________________________________________________
# BUILD RULES

.PHONY:	all target upload clean help

.SECONDARY: # keep intermediate files for study - delete with "make clean"

all: clean target upload

target: $(TARGET).o $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).lss
	@echo "Build of $(TARGET) complete.\n"

upload:
	@$(AVRDUDE_CMD)
	@echo "\nCommand line: $(AVRDUDE_CMD)\n"
	@echo "$(PART) erased, $(TARGET) uploaded.\n"

clean:
	@rm -f $(TARGET).d
	@rm -f $(TARGET).eep
	@rm -f $(TARGET).elf
	@rm -f $(TARGET).hex
	@rm -f $(TARGET).lss
	@rm -f $(TARGET).o

help:
	@echo "\n"
	@echo "makefile: supported arguments"
	@echo "-----------------------------"
	@echo "        make - just build or rebuild the project"
	@echo "  make clean - remove intermediate files to force a full recompilation"
	@echo "    make all - build project and upload it to the AVR via AVRDUDE"
	@echo "   make help - this message"
	@echo "\n"

#_______________________________________________________________________________
# BUILD THE TARGET

%.o: %.cpp
	@$(COMPILE.cpp) -MMD -MP -o $@ $<
	@echo "\n------------- 1: $< -> $@ --------------------"
	@$(AVRSIZE) $@
	@echo "--------------------------------------------------------------"

%.o: %.c
	@$(COMPILE.c) -MMD -MP -o $@ $<
	@echo "\n------------- 2: $< -> $@ --------------"
	@$(AVRSIZE) $@
	@echo "--------------------------------------------------------"

%.elf: %.o
	@$(CC) $(LINKFLAGS) -o $@ $<
	@echo "\n------------- 3: $< -> $@ --------------------"
	@$(AVRSIZE) $@
	@echo "--------------------------------------------------------------"

%.hex: %.elf
	@$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
	@echo "\n------------- 4: $< -> $@ ------------------"
	@$(AVRSIZE) $@
	@echo "--------------------------------------------------------------"

%.eep: %.elf
	@$(OBJCOPY) -O $(FORMAT) -j .eeprom \
	--set-section-flags=.eeprom=alloc,load \
	--no-change-warnings \
	--change-section-lma .eeprom=0 $< $@
	@echo "\n------------- 5: $< -> $@ ------------------"
	@$(AVRSIZE) $@
	@echo "--------------------------------------------------------------"

%.lss: %.elf
	@$(OBJDUMP) -d -f -w -C -S >$@ $<
	@echo "\n------------- 6: $< -> $@ ------------------\n"

Actually I can't even get it to load the project. By trial and error I removed one error by adding Arduion-core and processing. I still have one error:

Project 'processing-head' is missing required library: 'app/lib/ecj.jar'

AVR toolchain stuff

I believe that the OP is talking about compiling the Arduino IDE itself, not arduino sketches. So we're talking windows, macos, or linux toolchains. Java SDKs and such. AFAIK, the IDE is set up to build from the command line, using the "ant" make-like utility. Connect to the "build" directory and type "ant build" To use eclipse presumably requires somehow important the any project into eclipse; I wouldn't have a clue as to how to do that without an up-to-date tutorial...

It works fine (from the command line) on a Mac, though.

Yea I have the prerequisites installed in eclipse (ant, etc.) but the problem now is I can't load one of the projects (there are several with no documentation whatsoever). It's missing a file apparently. The people in the actual developers forum are a bunch of pricks. If you ask a question it either gets deleted without reason, or basically tell you to shut the hell up and go ask your question here in this forum so here I am...

Displacer: Yea I have the prerequisites installed in eclipse (ant, etc.) but the problem now is I can't load one of the projects (there are several with no documentation whatsoever). It's missing a file apparently. The people in the actual developers forum are a bunch of pricks. If you ask a question it either gets deleted without reason, or basically tell you to shut the hell up and go ask your question here in this forum so here I am...

The Arduino IDE is compiled using Apache ANT. You first have to compile the core, then the main code.

Again, don't know why you want anything to DO with the Arduino IDE since programming is so much easier with a text editor and Make (or with a real IDE and use it to call the AVR-GCC compiler).

I don't know what to tell you; you're looking for help from a vanishingly small subset of Arduino users: developers who work on the IDE in Eclipse. Perhaps there are NONE (there used to be an XCode project for compiling the IDE on Macs, but it disappeared in favor of ant a long time ago; I wouldn't expect to find any help at all for compiling the current IDE under XCode.)

It looks like there are a total of two IDE .project files in the source, one in the top level directory that defines processing-head, and one in arduino-core/ that defines arduino-core. They're pretty empty files, not containing much more info than "this is the arduino-core project"; I don't know how (or if) Eclipse would be incorporating additional info about how to do the actual build.