1# These two definitions are used if you 'make install'
2# the value of LIBDIR should be the same as OMEGALIB in defs.h
3BINDIR = /home/sdossey/omega/
4LIBDIR = /home/sdossey/omega/lib/
5
6# One of these should be uncommented, as appropriate, unless your compiler
7# does it for you.  You can test this by simply trying to 'make' omega -
8# it will fail if none of them are defined.  If you do uncomment
9# one, make sure you comment out the other definition of CFLAGS lower down
10
11CFLAGS = -DBSD -g
12#CFLAGS = -DSYSV -O
13# I also had to define -cckr (K&R style C) for system V
14#CFLAGS = -DMSDOS -O
15#CFLAGS = -DAMIGA -O
16
17# CPP should contain the command to run the C preprocessor.
18#CPP = cc -E
19#CPP = /lib/cpp
20CPP = gcc -E
21
22# If you have gcc and don't intend to hack around with the game,
23# I recommend setting CC to gcc and using -O (as the CFLAGS).
24
25#CFLAGS = -O
26#LDFLAGS = -s
27CC = gcc
28
29# comment out one of the following two, after establishing whether your
30# machine uses termcap (most BSD machines) or terminfo (System-V)
31#LIBS = -lcurses -ltermcap
32#LIBS = -lcurses -ltermlib
33LIBS = -lcurso
34
35#################### that's it for changing the Makefile ####################
36
37OBJ = omega.o abyss.o aux1.o aux2.o aux3.o char.o city.o\
38      clrgen.o command1.o command2.o command3.o\
39      country.o effect1.o effect2.o effect3.o\
40      etc.o env.o file.o gen1.o gen2.o guild1.o guild2.o house.o\
41      init.o inv.o item.o itemf1.o itemf2.o itemf3.o lev.o\
42      mmelee.o mmove.o mon.o move.o movef.o mspec.o\
43      mstrike.o mtalk.o priest.o\
44      save.o scr.o site1.o site2.o\
45      spell.o time.o trap.o util.o village.o compress.o
46
47omega: $(OBJ)
48	$(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o omega
49
50install: omega $(BINDIR) $(LIBDIR)
51	cp omega $(BINDIR)
52	chmod 4711 $(BINDIR)/omega
53	- cp lib/* $(LIBDIR)
54	chmod 0644 $(LIBDIR)/help*.txt $(LIBDIR)/license.txt $(LIBDIR)/motd.txt $(LIBDIR)/thanks.txt $(LIBDIR)/update.txt
55	chmod 0600 $(LIBDIR)/abyss.txt $(LIBDIR)/scroll[1234].txt $(LIBDIR)/*.dat
56	chmod 0600 $(LIBDIR)/omega.hi $(LIBDIR)/omega.log $(LIBDIR)/omegahi.bak
57
58install_not_suid: omega $(BINDIR) $(LIBDIR)
59	cp omega $(BINDIR)
60	chmod 0711 $(BINDIR)/omega
61	- cp lib/* $(LIBDIR)
62	chmod 0644 $(LIBDIR)/help*.txt $(LIBDIR)/license.txt $(LIBDIR)/motd.txt $(LIBDIR)/thanks.txt $(LIBDIR)/update.txt
63	chmod 0644 $(LIBDIR)/abyss.txt $(LIBDIR)/scroll[1234].txt $(LIBDIR)/*.dat
64	chmod 0666 $(LIBDIR)/omega.hi $(LIBDIR)/omega.log
65	chmod 0600 $(LIBDIR)/omegahi.bak
66
67clean:
68	rm -f $(OBJ) genclr genclr.o
69	rm -i omega
70
71$(OBJ): clrgen.h defs.h extern.h glob.h
72
73clrgen.h clrgen.c: genclr.c minit.h defs.h
74	$(MAKE) genclr
75	$(CPP) -DOMEGA_CLRGEN *.[ch] | genclr clrgen.c clrgen.h
76
77genclr: genclr.o
78	$(CC) $(LDFLAGS) genclr.o -o genclr
79