# The BUILD Script

The BUILD script is placed in the `WWW` directory and you can use it to compile and link the W3C applications. The BUILD script figures out what platform you are on and generates a `Makefile` which consists of a platform independent part and a platform dependent part. The independent stuff is all in

    	WWW/<application>/Implementation/CommonMakefile

whereas the platform dependent stuff can be found in

    	WWW/All/<platform>/Makefile.include

The `Makefile.include` contains all platform specific compiler flags, linker flags etc. If you encounter problems with the compiler, for example if you don't have it, then modify the flags in this file and retry BUILD.

If your application is not mentioned in the Platform page then read this section to find out about the BUILD script and how to port the source code to your platform. We assume you have a unix-like environment, including some sort of C (either Kernigan and Ritchie or ANSI) compiler, and a socket library supporting TCP/IP communications. If you are on a PC platform, VMS or other then it might require some more hard work depending on the application you want to port.

- Make a new subdirectory under `WWW/All` and give it a name that is characteristic to your platform. Often you can use the name given by the `uname` command:
- Copy the `Makefile.include` from another (similar) machine's subdirectory. You can find similar platforms for almost any known Unix platform into the new directory.
- Modify the `Makefile.include` as necessary to compile and install on your system. This involves selecting the compiler command, flags, etc, to be used, and specifying directory names.
- Add a line to the BUILD script so that the `WWW_MACH` environment variable can be set. You can often see how to do this by looking at the other entries in this file.
- Try out the BUILD script by typing in the `WWW` directory

      	./BUILD

  If the code doesn't compile then you have to look into the source code itself. Often the only module to modify is the tcp module which includes all system specific details such as system include files etc.
- Mail the Makefile, and any other changes you found were necessary, back to us (libwww@w3.org) so that other people can get the changes as well.

Now you can install the software according to the instructions given under the status page of the application you want to install.