Always snap to grid

Legacy:GnuMake

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Building UnrealScript with GNU Make[edit]

This page is relevant to UT2004 and possibly earlier.

I like to develop under Wikipedia:cygwin as it gives me civilized features like vi and forward-slashes for directories. If you think I'm mad, then this isn't the page for you.

To make new packages, you should put the source in $UTHOME/$MYMODNAME/Classes

Unreal's ucc make command is very disappointing since it does not examine dependencies or timestamps.

Here's a handy makefile for cygwin users. It goes in the same directory as the source files and lets you build the package just by going make in the source dir. Since your package will not be built unless it appears in the UT2004.ini file, this makefile also checks for its presence. If you can code a script to insert the desired line into the .ini file, then it will be fully automatic.

Session script:[edit]

Steve@bigbro /cygdrive/c/UT2004/MutTBSniper/Classes
$ ls
Makefile           TBSniperAmmo.uc        TBSniperAttachment.uc  TBSniperRifle.uc        TBSniperSmoke.uc
MutUseTBSniper.uc  TBSniperAmmoPickup.uc  TBSniperFire.uc        TBSniperRiflePickup.uc  TBSniperZoom.uc

Steve@bigbro /cygdrive/c/UT2004/MutTBSniper/Classes
$ cat Makefile
#
# Makefile for UT2004 projects under cygwin.
#
# Place this in your Classes directory next to all your sources.
#
# $Id: $

########################################################################
# Assign the name of your Package.

PKG=MutTBSniper

########################################################################
# You shouldn't need to change below this text for code-only mods. I
# haven't tried anything with meshes or textures yet, but chances are
# you just need to alter the INS wildcard declaration below
########################################################################

INS+=$(wildcard *.uc)
OUTS+=../../System/$(PKG).u
OUTS+=../../System/$(PKG).ucl

SYS=../../System

ifeq ($(shell fgrep EditPackages=$(PKG) $(SYS)/UT2004.ini),)
$(error You need to insert "EditPackages=$(PKG)" in $(SYS)/UT2004.ini after those packages it depends upon)
endif

$(OUTS): $(INS) Makefile
        @-rm $(OUTS)
        (cd $(SYS); ./UCC.exe make )


Steve@bigbro /cygdrive/c/UT2004/MutTBSniper/Classes
$

Enjoy!

El Muerte: doesn't this also work with other make tools? Like borland's make program, included with the free CBuilder 5.5 compile: http://www.borland.com/products/downloads/download_cbuilder.html#

Sweavo: possibly, but I wouldn't like to bet on it: all versions of make are subtly different, and I wouldn't bet on the $(shell ...) or $(wildcard ...) functions being present anywhere except gnu make 3.80.