| 1 |
### These two definitions are used if you 'make install' |
| 2 |
### the value of LIBDIR should be the same as OMEGALIB in defs.h |
| 3 |
BINDIR = ./omega/ |
| 4 |
LIBDIR = ./lib/ |
| 5 |
|
| 6 |
### choose your optimization level |
| 7 |
OFLAGS = -O2 |
| 8 |
|
| 9 |
### One of these should be uncommented, as appropriate, unless your compiler |
| 10 |
### does it for you. You can test this by simply trying to 'make' omega - |
| 11 |
### it will fail if none of them are defined. If you do uncomment |
| 12 |
### one, make sure you comment out the other definition of CFLAGS lower down |
| 13 |
|
| 14 |
CFLAGS = -ggdb -Wall $(OFLAGS) -DBSD # -ansi |
| 15 |
#CFLAGS = -DSYSV $(OFLAGS) |
| 16 |
#CFLAGS = -DMSDOS $(OFLAGS) |
| 17 |
#CFLAGS = -DAMIGA $(OFLAGS) |
| 18 |
|
| 19 |
### CPP should contain the command to run the C preprocessor. |
| 20 |
#CPP = cc -E |
| 21 |
#CPP = /lib/cpp |
| 22 |
CPP = gcc -E |
| 23 |
|
| 24 |
### define a compiler |
| 25 |
CC = gcc |
| 26 |
|
| 27 |
### Select one of the following that is appropriate for your curses... |
| 28 |
### Comment ALL of them out if you are using opcurses |
| 29 |
#LIBS = -lncurses -ltermcap |
| 30 |
#LIBS = -lcurses -ltermlib |
| 31 |
#LIBS = -lpdcurses |
| 32 |
#Linux links in term?? automatically. |
| 33 |
#LIBS = -lncurses |
| 34 |
|
| 35 |
### uncomment to use "op-curses" package |
| 36 |
OPDEF = -DUSE_OPCURSES |
| 37 |
CUROBJ = ../opcurses/curses.o ../opcurses/curgtk.o |
| 38 |
|
| 39 |
### uncomment to compile using opcurses GTK+ driver |
| 40 |
CPPFLAGS = `gtk-config --cflags` -DUSE_OPCURSES |
| 41 |
LDFLAGS = `gtk-config --libs` |
| 42 |
|
| 43 |
#################### that's it for changing the Makefile #################### |
| 44 |
|
| 45 |
OLIBSTUFF = tools/libsrc/maps.dat lib/maps.dat |
| 46 |
|
| 47 |
TOOLS = tools/crypt tools/decrypt tools/makedate |
| 48 |
|
| 49 |
CLROBJ = clrgen.o |
| 50 |
|
| 51 |
OBJ = omega.o abyss.o aux1.o aux2.o aux3.o bank.o char.o city.o\ |
| 52 |
command1.o command2.o command3.o country.o date.o effect1.o\ |
| 53 |
effect2.o effect3.o etc.o env.o file.o gen1.o gen2.o guild1.o guild2.o\ |
| 54 |
house.o init.o inv.o item.o itemf1.o itemf2.o itemf3.o lev.o map.o\ |
| 55 |
mmelee.o mmove.o mon.o move.o movef.o mspec.o mstrike.o mtalk.o\ |
| 56 |
newrand.o priest.o pdump.o save.o scr.o site1.o site2.o spell.o\ |
| 57 |
stats.o time.o trap.o util.o village.o |
| 58 |
|
| 59 |
all: maps.dat omega |
| 60 |
|
| 61 |
omega: $(CUROBJ) $(CLROBJ) $(OBJ) |
| 62 |
$(CC) $(LDFLAGS) $(OFLAGS) $(CUROBJ) $(CLROBJ) $(OBJ) $(LIBS) -o omega |
| 63 |
rm date.c date.o |
| 64 |
|
| 65 |
date.c: |
| 66 |
tools/makedate > date.c |
| 67 |
|
| 68 |
maps.dat: |
| 69 |
cd tools; make |
| 70 |
cd tools/libsrc; make maps.dat |
| 71 |
|
| 72 |
install: omega maps.dat $(BINDIR) $(LIBDIR) |
| 73 |
cp omega $(BINDIR) |
| 74 |
chmod 4711 $(BINDIR)/omega |
| 75 |
- cp lib/* $(LIBDIR) |
| 76 |
cp maps.dat $(LIBDIR) |
| 77 |
chmod 0644 $(LIBDIR)/help*.txt $(LIBDIR)/license.txt $(LIBDIR)/motd.txt $(LIBDIR)/thanks.txt $(LIBDIR)/update.txt |
| 78 |
chmod 0600 $(LIBDIR)/abyss.txt $(LIBDIR)/scroll[1234].txt $(LIBDIR)/maps.dat |
| 79 |
chmod 0600 $(LIBDIR)/omega.hi $(LIBDIR)/omega.log $(LIBDIR)/omegahi.bak |
| 80 |
|
| 81 |
install_not_suid: omega maps.dat $(BINDIR) $(LIBDIR) |
| 82 |
cp omega $(BINDIR) |
| 83 |
chmod 0711 $(BINDIR)/omega |
| 84 |
- cp lib/* $(LIBDIR) |
| 85 |
cp maps.dat $(LIBDIR) |
| 86 |
chmod 0644 $(LIBDIR)/help*.txt $(LIBDIR)/license.txt $(LIBDIR)/motd.txt $(LIBDIR)/thanks.txt $(LIBDIR)/update.txt |
| 87 |
chmod 0644 $(LIBDIR)/abyss.txt $(LIBDIR)/scroll[1234].txt $(LIBDIR)/*.dat |
| 88 |
chmod 0666 $(LIBDIR)/omega.hi $(LIBDIR)/omega.log |
| 89 |
chmod 0600 $(LIBDIR)/omegahi.bak |
| 90 |
|
| 91 |
clean: |
| 92 |
rm -f $(OBJ) clrgen.h clrgen.c genclr.o genclr omega |
| 93 |
|
| 94 |
distclean: |
| 95 |
rm -f $(OBJ) $(CUROBJ) $(TOOLS) $(OLIBSTUFF) clrgen.h clrgen.c genclr.o genclr omega |
| 96 |
cp lib/omega.hi.backup lib/omega.hi |
| 97 |
cp lib/omega.log.backup lib/omega.log |
| 98 |
|
| 99 |
$(CUROBJ): ../opcurses/curses.h ../opcurses/cmacros.h ../opcurses/xcurses.h |
| 100 |
|
| 101 |
$(CLROBJ): clrgen.h |
| 102 |
|
| 103 |
$(OBJ): defs.h extern.h glob.h iinit.h minit.h clrgen.h |
| 104 |
|
| 105 |
clrgen.h clrgen.c: genclr.c minit.h defs.h |
| 106 |
$(MAKE) genclr |
| 107 |
$(CPP) $(OPDEF) -DOMEGA_CLRGEN *.[ch] | ./genclr clrgen.c clrgen.h |
| 108 |
|
| 109 |
genclr: genclr.o |
| 110 |
$(CC) $(LDFLAGS) genclr.o -o genclr |