############
# Programs #
############
CC = @lc
INFO = @echo
LINKER = @lcclnk
MAKEDIR = @mkdir
#####################
# Operating Systems #
#####################
LINUX = -DNOLINUX
SRC2 = getopt.obj getopt1.obj SDL_win32_main.obj
OS = Win32
####################
# Compiler options #
####################
#Libraries: include path and linked libs
INCLUDE = -Iinclude -Iports\include -Iports\include\sdl
LIBS = SDL.lib
#Defines
DEFINES = -DOS=\"$(OS)\" $(LINUX) -DOUTPUT_FULLSCREEN
#Release type
# RELEASE may be:
# -g -Wall -ansi -pedantic for debug
# -O2 for release
# LINKERRELEASE may be:
# -s for release
RELEASE =
LINKERRELEASE = -s
#Binary code files
OBJFILES = main.obj kernel.obj resources.obj dat.obj disk.obj compress.obj \
output.obj maps.obj config.obj room.obj titles.obj \
input.obj kid.obj states.obj tiles.obj walls.obj anims.obj object.obj\
$(SRC2)
EXEFILE = bin\freeprince.exe
#Use this to temporary remove an option
OPTIONS = $(INCLUDE) $(DEFINES) $(RELEASE)
LINKEROPTIONS = $(LINKERRELEASE)
#############
# main file #
#############
$(EXEFILE): $(OBJFILES)
$(INFO) Linking files...
@rem if not exist bin mkdir bin
$(LINKER) $(OBJFILES) $(LIBS) $(LINKEROPTIONS) -o $(EXEFILE)
$(INFO) Program successfully compiled
###################
# command options #
###################
clean:
$(INFO) Erasing temporary object files...
del *.obj
build: clean $(EXEFILE)
all: index build
install: download build
################
# Source files #
################
main.obj: main.c include\kernel.h include\main.h
$(INFO) Compiling command line parser...
$(CC) $(OPTIONS) -c main.c
resources.obj: res\resources.c include\resources.h include\compress.h \
include\dat.h include\disk.h include\res_conf.h
$(INFO) Compiling main resource manager module...
$(CC) $(OPTIONS) -c res\resources.c
disk.obj: res\disk.c include\memory.h include\disk.h include\resources.h include\res_conf.h
$(INFO) Compiling resource disk access library...
$(CC) $(OPTIONS) -c res\disk.c
dat.obj: res\dat.c include\disk.h include\dat.h
$(INFO) Compiling resource dat editing library...
$(CC) $(OPTIONS) -c res\dat.c
kernel.obj: ker\kernel.c include\kernel.h include\resources.h include\res_conf.h include\output.h
$(INFO) Compiling main kernel...
$(CC) $(OPTIONS) -c ker\kernel.c
room.obj: ker\room.c include\room.h include\resources.h include\res_conf.h
$(INFO) Compiling kernel room object...
$(CC) $(OPTIONS) -c ker\room.c
kid.obj: ker\kid.c include\kid.h include\resources.h include\res_conf.h
$(INFO) Compiling kernel kid object...
$(CC) $(OPTIONS) -c ker\kid.c
titles.obj: ker\titles.c include\resources.h include\res_conf.h
$(INFO) Compiling kernel titles module...
$(CC) $(OPTIONS) -c ker\titles.c
compress.obj: res\compress.c include\compress.h include\memory.h \
include\disk.h
$(INFO) Compiling resource compression module...
$(CC) $(OPTIONS) -c res\compress.c
maps.obj: res\maps.c include\maps.h
$(INFO) Compiling resource map handling module...
$(CC) $(OPTIONS) -c res\maps.c
output.obj: out\output.c include\resources.h include\res_conf.h
$(INFO) Compiling main output module...
$(CC) $(OPTIONS) -c out\output.c
states.obj: ker/states.c include/states.h include/states_conf.h\
include/resources.h include/res_conf.h include/types.h\
include/tiles.h include/tiles_conf.h
$(INFO) Compiling kernel states module...
$(CC) $(OPTIONS) -c ker\states.c
tiles.obj: res/tiles.c include/tiles.h include/tiles_conf.h
$(INFO) Compiling resource tile classification module...
$(CC) $(OPTIONS) -c res\tiles.c
input.obj: out\input.c include\input.h
$(INFO) Compiling main input module...
$(CC) $(OPTIONS) -c out\input.c
config.obj: res\config.c include\resources.h include\res_conf.h
$(INFO) Compiling resource configuration module...
$(CC) $(OPTIONS) -c res\config.c
walls.obj: res\walls.c include\walls.h include\walls_conf.h
$(INFO) Compiling wall algorithm module...
$(CC) $(OPTIONS) -c res\walls.c
anims.obj: res\anims.c include\anims.h include\anims_conf.h
$(INFO) Compiling animation loader module...
$(CC) $(OPTIONS) -c res\anims.c
object.obj: ker\object.c include\object.h include\resources.h include\res_conf.h\
include\states.h include\res_conf.h\
include\types.h include\tiles.h include\tiles_conf.h include\output.h\
include\kid.h
$(INFO) Compiling kernel kid object support...
$(CC) $(OPTIONS) -c ker\object.c
getopt.obj: ports\getopt.c
$(INFO) Porting the Unix-like getopt function (first part)...
$(CC) $(OPTIONS) -c ports\getopt.c
getopt1.obj: ports\getopt1.c
$(INFO) Porting the Unix-like getopt function (second part)...
$(CC) $(OPTIONS) -c ports\getopt1.c
SDL_win32_main.obj: ports\SDL_win32_main.c
$(INFO) Porting the SDL main function...
$(CC) $(OPTIONS) -c ports\SDL_win32_main.c