|
we do and without them we would not exist so as for us they are still an important assett
|
|
|
|
|
I still do. Had to write a couple recently in fact.
Scott
|
|
|
|
|
Mostly when I write C programs for old 8 bit computers. The BAT then is a kind of simple makefile (another thing the youngsters usually don't know anything about) and also handles the deployment of the compiled program to the emulator(s).
I'm invincible, I can't be vinced
|
|
|
|
|
I've been using the make file that gets automagically created by the
AVRStudio 5.1 but am looking to tweek, or just generally learn more
about them. I googled quite a bit but have not found any good tutorials
any sugs?
|
|
|
|
|
A makefile is nothing more than a batch file with a command line to call the compiler for each source file, then one or more command lines calling the linker and perhaps some commands to deploy or copy the results. An IDE usually lets you edit all kinds of compiler and linker options and then generates the makefile from the contents of your project and those options.
Or you can simply write the makefile yourself with any simple editor like wordpad. You just have to know how to call the compiler and linker and what options and parameters your compiler needs or supports. It's just like writing command lines in the console. The makefile only saves you from typing all this every time you want to build your project. I guess, all this should be documented in the compiler's and linker's documentation.
Edit: Usually the compiler includes some tool to process the makefile. My simple C compiler for old 8 bit machines does not, so I use plain vanilla .BAT files, which does not really make much of a difference. Whenever I want to build my project, I simply call something like 'make.bat' at the command line and look what kind of results I get in the in the console.
Edit^2: I just dug this[^] out in MSDN. It describes how to build from the command line with makefiles and NMAKE. NMAKE is a little more powerful than a simple batch and the commands are not simple command lines anymore, but it's still very much the same idea.
I'm invincible, I can't be vinced
modified 22-Feb-12 9:36am.
|
|
|
|
|
The IDE uses gcc for compiling and linking but the makefile is really
a generic file used to build the code. The problem I have is understanding
the commands. For some reason haven't been able to wrap my little brain
around it.
|
|
|
|
|
It's really just a batch job, compiling each source file with the options you want. The results (usually .obj files) are then bound to gether by the linker, again using the linking options you specify. The result should be some kind of executable. The rest of the makefile just deals with finding the required libraries, cleaning up or deplaying your compiled executable to whereever you want to have it.
It's really just a simple script to describe the build process. Don't let all those options or fancy (but not really important) features like including other makefiles confuse you. Just take a look at the gcc documentation and try it step by step with a very simple test project with, let's say, two source file. Once you have that working, you can go on and try out all kinds of options to see what effect they have.
I'm invincible, I can't be vinced
|
|
|
|
|
NMake can be downloaded from the MSDN directly if you have a 32bit OS. If you have 64bit, then that 16bit NMake download will not run! You have to install the Express Edition or higher of Visual C++ and find it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin there is another file called nmakeui.dll at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\1033 but I didn't use it.
Why would I go to the trouble? Perl scripts, not wholelly related to .BAT, but a script nonetheless - mine tend to be 20K to 200K per file! On a 64bit Windows OS with no 16bit support like Win7: to install CPAN modules (type cpan at a dos prompt after installing ActiveState Perl), you need Perl, MingW and MSys for the compiler, and NMake. This was fine till we upgraded - well, downgraded my laptop since this $3k Elitebook crashes constantly - to 64bit. I was stuck without the modules and had to figure out a way to get NMake.
My Macbook Pro will be here today I hope, btw. Can't wait to get Windows 7 installed on it! Not an Apple fanboi, but I doubt I am going to freeze, BSOD or put up with random sticking letter or key of the day issues...
|
|
|
|
|
Moi
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Our team and myself as well write cmd files which should be about the same thing as bat files as far as I'm concerned.
We use the stuff on our FAST servers to do operations automation.
Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Still used around here for some server-to-client installs.
In fact, it's even to be used for a one-shot dumb update.
They do what they're supposed to do and are easy to write.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Dalek Dave wrote: Who (apart from my good self) still writes .bat files?
I stray occasionally.
|
|
|
|
|
I write Windows services which run .Bat files 
|
|
|
|
|
I write the odd one now and agian, well cmd files anyway,
I tend to use a few that I keep around more than writing me ones though - like moving large numbers of files around and renaming etc.
Right tool for the right job, as my father used to say.
Not sure I liked it that he called me a tool, but there you go.
|
|
|
|
|
_Maxxx_ wrote: Not sure I liked it that he called me a tool, but there you go.
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|
|
I don't by choice, but have to at work to support old code that uses them, and code from another company that uses them.
|
|
|
|
|
I've used it twice last year, took me a while to remember how to pass arguments in though.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I am lazy.
I could use a streamwriter within the code, call it and then discard it.
But I don't.
I just write the .bat and .txt and get call them within a shell in c# or vb.
Bad habits die hard!
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|
|
I used it to run a XLST to PDF conversion application, using the commandline tool it take around 8 milliseconds to create the PDF and with .NET managed code upto 15 seconds decpending on the report.
So it was a no brainer moment on which to use.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Rarely I do, yes. But I don't bat an eye when I have to.
.....................
Life is too shor
|
|
|
|
|
Funny you should ask, I didn't write any but I got my new desktop this morning, and and used a couple to set up some of my complier envirionments.
And I used the one to show hidden devices in the device manager to clean the crud out.
It was broke, so I fixed it.
|
|
|
|
|
Yes, I keep modifying my "Autoexec.bat". And my "Config.sys".
|
|
|
|
|
He he - list of files in the current directory ? Nothing quicker than:
dir /b >> list.txt
|
|
|
|
|
Dalek Dave wrote: Who (apart from my good self) still writes .bat files?
I do from time to time. Some things, never die.
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011) "No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011)
"It is the celestial scrotum of good luck!" - Nagy Vilmos (2011)
|
|
|
|
|
I generally only use them for trivial things, otherwise I'll write a short command line C# tool. I like the security of using a real language, and the .Net Framework's always in memory on my machine anyway so execution time is trivial.
|
|
|
|