Netbeans + WinAVR

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good day!

I've existing project with makefile created from WinAVR template. I used to build a program with 'make all' and program it with 'make program'.
I've created project "C/C++ application with existing source" in NetBeans, it recognizes WinAVR toolchain, but I can't specify my target for build.

It seems NetBeans creates some additional makefiles and run them, not my makefile directly (from netbeans console):

"C:/Tools/avr/WinAVR/utils/bin/make" -f nbproject/Makefile-Default.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `C:/WinAVR_Playground'

....

Changing this does nothing -- always 'all' target is executed

# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
	cd . && $(MAKE) -f Makefile clean

file nbproject/Makefile-Default.mk:

#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.


# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=avr-gcc.exe
CCC=avr-g++.exe
CXX=avr-g++.exe
FC=
AS=avr-as.exe

# Macros
CND_PLATFORM=WinAVR-Windows
CND_CONF=Default
CND_DISTDIR=dist

# Include project Makefile
include Makefile-WinAVR_Playground.mk

# Object Directory
OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}

# Object Files
OBJECTFILES=


# C Compiler Flags
CFLAGS=

# CC Compiler Flags
CCFLAGS=
CXXFLAGS=

# Fortran Compiler Flags
FFLAGS=

# Assembler Flags
ASFLAGS=

# Link Libraries and Options
LDLIBSOPTIONS=

# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
	cd . && $(MAKE) -f Makefile clean

# Subprojects
.build-subprojects:

# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
	cd . && $(MAKE) -f Makefile clean

# Subprojects
.clean-subprojects:

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never heard of anyone using NetBeans for AVR development - the usual IDE front ends chosen for avr-gcc are Eclipse or Code:Blocks - you'll get much more support using those.

As it sounds like you are in Windows you can, of course, use AVR Studio as an IDE (though the editor is terrible) or you can even use the free Microsoft Visual Studio Express - again this has been done by a few folks so you are more likely to be able to find support for this combination.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems Netbeans are not so common for AVR, but the fact it recognizes toolchain give me some hope :)

By the way, when I specify "__AVR_ATmega8__" as "preprocessor definition" it gives me full code completion including all registers etc.

I use both Netbeans and Visual Studio Express for my day-time job, so thank you about VS Express tip.

By, the way, is it possible to integrate serial monitor to any IDE? I use bootloader, so it is a pain to turn monitor off, upload using 'make program', switch monitor back.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In case anybody interested, just quick and dirty hack:

1. I've wiped out the Makefile-.mk that NetBeans created in the root of the project

2. Put this in it:

all:
	make all

clean:
	make all
	make program

Now with F11 ("Build" in menu) I get build, on Shift-F11 ("Clean and build") I get build and uploading to device.

For 'clear' I can run it from command-line.

Very dirty hack, but I get:
- Full code completion with code tips
- Build and upload with hot keys

Not bad? :)

As far as I understand I just added additional call to make in Netbeans's make tasks.