Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Thinking in Java
Prev Contents / Index Next

Problems with make

The concept of make is clearly a good idea, and this idea proliferated to produce many versions of make. C and C++ compiler vendors typically included their own variation of make along with their compiler—these variations often took liberties with what people considered to be the standard makefile rules, so the resulting makefiles wouldn’t run with each other. The problem was finally solved (as has often been the case) by a make that was, and still is, superior to all the other makes, and is also free, so there’s no resistance to using it: GNU make.[94] This tool has a significantly better feature set than the other versions of make and is available on all platforms.

In the previous two editions of Thinking in Java, I used makefiles to build all the code in the book’s source-code tree. I automatically generated these makefiles—one in each directory, and a master makefile in the root directory that would call the rest—using a tool that I originally wrote in C++ (in about 2 weeks) for Thinking in C++, and later rewrote in Python (in about half a day) called[95] It worked for both Windows and Linux/Unix, but I had to write extra code to make this happen, and I never tried it on the Macintosh. Therein lies the first problem with make: You can get it to work on multiple platforms, but it’s not inherently cross-platform. So for a language that’s supposed to be “write once, run anywhere” (that is, Java), you can spend a lot of effort getting the same behavior in the build system if you use make.

The rest of the problems with make can probably be summarized by saying that it is like a lot of tools developed for Unix; the person creating the tool couldn’t resist the temptation to create their own language syntax, and as a result, Unix is filled with tools that are all remarkably different, and equally incomprehensible. That is to say, the make syntax is quite difficult to understand in its entirety—I’ve been learning it for years—and has lots of annoying things like its insistence on tabs instead of spaces.[96]

All that said, note that I still find GNU make indispensable for many of the projects I create.
Thinking in Java
Prev Contents / Index Next

   Reproduced courtesy of Bruce Eckel, MindView, Inc. Design by Interspire