Separate Compilation of Manhattan Components

Instead of simply typing:

make clean
make english (or spanish, or..)
make install

to compile and install Manhattan, you may also take advantage of the additional targets in the Makefile to break this process down into smaller steps. This may be useful to you if you have trouble compiling portions of Manhattan on your system, since it allows you to isolate where the trouble is.

My philosophy is to try to produce a self-contained install package for Manhattan, even though an increasing part of Manhattan was written by other open source developers. (See the CREDITS file for a list.) For example, Manhattan uses the standard zip and unzip programs to make it easy for teachers and students to upload amd download "web sites". While I could assume that every Linux system has zip and unzip installed, I don't. Instead, I've packaged the complete zip and unzip sources, which are compiled along with the rest of Manhattan.

In the unlikely event my versions of zip and unzip won't compile on your system, you can probably use the versions found on your filesystem.

The following series of commands, when typed in the order shown, have the same net effect as the make clean; make english; make install combination above. The list is followed by a description of each 'target' with some ideas about what can be skipped if necessary:

make clean
make english
make cgihtml.a
make libexpat.a
make libmanhat.a
make manhattan
make zip
make unzip
make melange_chat
make mkthumb

make install_manhat
make install_melange
make install_images
make install_zip
make install_unzip
make install_mkthumb
make dirs
make strip
clean

Deletes all programs within the src directory, which were created as a result of a previous compile. This puts the src directory in pretty much the same state it was in when you first unpacked the distribution.

english

Creates two symbolic links

lang.h --> languages/english/lang.h
images --> languages/english/images

lang.h contains all of the language-specific strings used by Manhattan. This symbolic link must exist, or Manhattan can not be compiled. The images directory contains the graphic buttons for a particular language. make install_images will copy these images to Manhattan's images directory. This is a required step.

cgihtml.a

Creates Eric Kim's cgihtml.a library, which is required by Manhattan. The source code for this library is in the src/cgihtml-1.69 directory. This is a required step.

libexpat.a

Creates the libexpat.a library, which is used to parse XML data. The source code for this library is in the src/expat directory. This is a required step.

libmanhat.a

Creates a library of manhattan-specific functions that are required by the core Manhattan programs. The source code for this library is in the src/manhat-lib directory. This is a required step.

manhattan

Creates the core Manhattan CGI programs. The source for these programs is in the src directory of the distribution. This is a required step.

zip

Creates the zip utility used within Manhattan when a teacher requests a zipped copy of an attached website. The source code is located in the src/zip-2.3 directory.

This utility is the standard Info-ZIP zip program. If make zip fails with an error on your system (it does under OS/X), then you can probably use the standard copy of zip provided with your operating system system. Put the program in the bin directory of your Manhattan installation and skip the make install_zip step.

unzip

Creates the unzip utility used within Manhattan when a student or teacher attaches a wesite to a message that has been zipped. The source code is located in the src/unzip-5.40 directory.

This utility is the standard Info-ZIP unzip program. If make unzip fails with an error on your system (it does under OS/X), then you can probably use the standard copy of 'unzip' provided with your operating system. Put it in the bin directory of your Manhattan installation and skip the make install_unzip step.

melange_chat

Creates the melange chat server, which make install_melange will copy into the ../chat directory of your installation. The source for the chat server is in src/melange/server/src

Manhattan will work fine without this piece, although of course, people won't be able to use the Chat module. If for some bizarre reason this step fails, skip the make install_melange step until you can figure out why.

mkthumb

Creates a program called mkthumb that's used by the People module to create thumbnail-sized jpeg images of uploaded photographs. Manhattan will work fine without this utility, however people won't be able to upload photos as part of their "Personal Info Pages" if you don't have it.

The make mkthumb command starts a compilation that's nearly as big as the rest of Manhattan, although the utility it creates is small, and is of minor significance to Manhattan. This is because mkthumb uses a graphics library called gd.a, which in turn uses a graphics library called libjpeg.a.

I've included the source code for both of these libraries, along with the mkthumb source in the directory src/mkthumb-1.2.1

If Manhattan's distribution of mkthumb doesn't compile on your system (it does on every Linux/FreeBSD system I've tried), don't worry about it for now. Just skip the make install_mkthumb step.

Then you can grab a copy of mkthumb directly from http://mkthumb.sourceforge.net and see what can be done to get a binary working for your system. The mkthumb program goes in Manhattan's bin directory.

install_manhat

Copies the core Manhattan programs to the ../bin and ../sbin directories. You can't skip this step.

install_melange

Copies the melange chat server files, created with the make melange_chat command (see make melange_chat) into the ../chat directory. You can skip this if make melange_chat produces an error you can't figure out, but users won't be able to use the chat module.

install_images

Copies the image files and various JavaScript files to the ../images directory. You can't skip this step.

install_zip

Copies the zip program to the ../bin directory. You can skip this if make zip doesn't work for you. You shouldn't run Manhattan without a 'zip' program, since teachers won't be able to download "attached websites" as zip files.

install_unzip

Copies the unzip program to the ../bin directory. Skip this only if make unzip doesn't work for you. You shouldn't run Manhattan (for long at least) without an unzip program, since users won't be able to upload large "attached websites" as a single zip file.

install_mkthumb

Copies the mkthumb program, generated by the make mkthumb command, to the ../bin directory. Skip this only if make mkthumb doesn't work for you.

dirs

Creates a number of required directories to hold courses, temporary files, surveys, etc. and properly sets the access rights for all directories and program files. This step can't be skipped.

strip

Uses the standard strip utility to reduce the size of Manhattan's many executable programs. Stripped programs are smaller and load faster, which is a good thing for CGI programs. Although it would be hard to find a Un*x system without 'strip' installed, this really is an optional step, which can be skipped if necessary.