Notepad++ with avr-gcc error - gcc

I want to create a run command in notepad++, that cleans/deletes the compiled files whenever I press Ctrl + M. So far I created this line of code :
cmd /k c:\WinAVR-20100110\utils\bin\make.exe make clean $(FULL_CURRENT_PATH)
It does not work and gives this warning :
No Rule To make target clean
Which technically means the parameter is wrong, however I did not find a way to correct it.
Any Suggestions

You don't want to pass make as an argument to make because then it will look for a target named make which is not defined.
Also, you would need to make sure make is running in the right directory. One way to do that is use the -C option. For example:
make -C path/to/my/dir clean
Some unsolicited tips: WinAVR is really old, see how you are using the version from 2010-01-10? I'd recommend using MSYS2 for your Bash shell environment and then installing the latest AVR 8-bit toolchain from Atmel.

Related

Generate make file

I have a golang CLI program which generates a makefile to a specific project. While this works, there is an issue when the project already has a makefile. Of course I can check that in advance to avoid collusion, but how is it suggested to do it?
I'm not an expert in makefiles, but how can I create second makefile (maybe with the project name or something) that user can run via make (I guess with additional steps or info to the terminal)
You can generate it as Makefile.project and document to be run as make -f Makefile.project
You can give your Makefile whatever filename. Then make must be executed with parameter -f <your_filename> or --file=<your_filename>. See make manual on filenames.
Which version of make are you using? Some versions run special makefiles before others. For example, GNU make looks for the following files and runs the first one it finds: GNUmakefile, Makefile, makefile.
If you are using GNU make, then name your generated file GNUmakefile and add in the making any makefile already in the directory. That way, anyone running make in the directory will automatically run the generated makefike first.

Can I configure gfortran-4.9 to mean gfortran in terminal?

I'm having many problems installing packages where they have the default compiler as gfortran, and no master command to change it to gfortran-4.9
So I'd like to know if it's possible that whenever I type the gfortran command in the terminal, it interprets it to mean gfortran-4.9?
Looks like the alias command is used for exactly this.
I used alias gfortran="gfortran-4.9" in the terminal to get just that.
To get a permanent effect, I typed the command into ~/.bash_profile config file.

Force mingw32-make to ignore sh

I noticed that, if sh.exe is present in the PATH, then mingw32-make will use it to launch commands. But if it is not, then it will use cmd.exe. The problem is that both application are .... completely incompatible, and there is no way to create makefiles to would work for both.
Is there a way to ask mingw32-make to always use cmd.exe? Or to create an environment forcing mingw32-make to ignore this sh.exe?
Turns out, I found the solution by chance. I had read that mingw32-make is supposed to look at the SHELL environment variable ... but it doesn't! However, you can specify the option on the command line like so:
mingw32-make SHELL=cmd
This is not ideal, but the best I could come up with. For now, I will leave this question un-answered, in case someone comes with a better answer.
I had similar issue, and resolved it by launching the make from a batch file, but before calling the make added:
set PATH... with only the necessary roots.

How Do I Build Lua For Windows Using MinGW and MSYS?

I have a book called Beginning Lua Programming which is suppose to go over the raw basics but it is sort of leaving me stranded. Here is an effort to condense 3 pages:
QUOTE:
The following environment variables are recommended for Windows:
UTIL_DIR=c:\program files\utility
LUA_DIR=c:\program files\lua\5.1
LUA_CPATH=?.dll;%LUA_DIR%\?.dll
LUA_PATH=?.lua;%LUA_DIR%\?.lua
The UTIL_DIR variable identifies the utility directory you created in the preceding section.
After this, there is a segment about setting the 'windows search path' for lua. Basically, it tells me to look up the output of 'doskey /?' and 'path' and figure it out myself. I have no idea what these do, how to use them, and what the difference between them is.
I'm at my wits end. A detailed explanation or a link to a detailed blog/article or youtube video is EXTREMELY appreciated!
There are a few ways to get Lua working on your machine. If you just want to a functional Lua environment in a hurry with minimal fuss then consider downloading one of the precompiled Lua binaries. The common ones being Lua for Windows and LuaBinaries.
Building Lua with Mingw isn't too difficult:
First get your desired Lua version here.
Extract the tar file containing Lua's source somewhere. For this example, I'll assume you extracted to c:\lua
If you have Msys already set up, you can run the make file from that environment. From the Msys shell, you can build lua with the follow commands:
cd /c/lua
make PLAT=mingw
make install
You should find lua.exe and luac.exe somewhere in there after the build completes. Lua should be ready for use at this point.
The regular cmd.exe shell can work too with some changes to the commands:
cd lua
mingw32-make PLAT=mingw
The make install assumes a *nix environment and so doesn't work under a normal windows cmd shell. In this case you can just manually copy the compiled files from .\lua\src to where you want or you can just run it directly from there if desired.

How do I configure CMake to make the VS solution use a specific build commandline?

I am trying to set up CMake to generate a MSVC (2010) solution for our project, and need to configure the projects so that they use our specific build system rather than compiling using the default command line.
Here's what the project file looks like for VS2008 (which we generate using another script that I'd like to get away from):
<Tool
Name="VCNMakeTool"
BuildCommandLine="../bam.bat -j %%NUMBER_OF_PROCESSORS%%"
ReBuildCommandLine="../bam.bat -j %%NUMBER_OF_PROCESSORS%% -c && ../bam.bat -j %%NUMBER_OF_PROCESSORS%%"
CleanCommandLine="../bam.bat -j %%NUMBER_OF_PROCESSORS%% -c "
Output="..\..\..\common\win32\container.exe"
PreprocessorDefinitions=""
IncludeSearchPath=""
ForcedIncludes=""
AssemblySearchPath=""
ForcedUsingAssemblies=""
CompileAsManaged=""
/>
It's basically the three CommandLine settings I'd like to be able to specify from my cmake config.
I've found the build_command command in the documentation but from the description it sounds like it does sort of the opposite of what I want, i.e. writes the command line it'll generate to a variable rather than take a string and set the command line to that.
Something that seems a bit related is the cross-compile feature in CMake but I'm sure if that is a good way to do this.
Basically I just want VS to run a batch file when I do a build and then parse the results back to get nice error messages etc.
It looks to me like what you want is simply a "custom command" in CMake parlance.
Something like:
set(custom_exe "${CMAKE_CURRENT_BINARY_DIR}/common/win32/container.exe")
add_custom_command(OUTPUT ${custom_exe}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bam.bat -j $ENV{NUMBER_OF_PROCESSORS}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bam.bat
)
add_custom_target(bam ALL DEPENDS ${custom_exe})
Maybe you need to write your own CMake Toolchain. You can see examples of toolchains in CMAKE_ROOT/share/Modules/Platform, or in CMake documentation, but i'm not sure whether cmake can generate MSVC solution for custom compiler.

Resources