File: Makefile

package info (click to toggle)
empire-lafe 0.39
  • links: PTS
  • area: main
  • in suites: potato, slink
  • size: 1,072 kB
  • ctags: 1,012
  • sloc: ansic: 12,827; makefile: 211
file content (86 lines) | stat: -rw-r--r-- 2,530 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# $Id: Makefile,v 0.15 1996/09/12 00:34:00 dld Exp $
#
# Makefile for lafe (Latency Free Empire)
#
#     This makefile has specific clauses for target machines.  If your machine
#  isn't listed, first try the "termcap" and "curses" machines.  If these
#  don't work, add a clause with the necessary compile and link flags for
#  your machine, and send me an email.  I hate #ifdefs in the code, and
#  struggle to eliminate them through compile/link flags.
#    GNU readline is in the readline/ directory, and uses a configure script.
#  It works (with the occaisional prod) on the machines I've used.  YMMV.
#  Good luck debugging/porting it if your machine isn't a supported target
#  of readline.
#
#     -Drake (harmless@empire.net)



SHELL = /bin/sh

SRC = lafe.c alias.c history.c parse.c var.c game.c
OBJ = $(SRC:.c=.o)

all:
	@echo "Chose one of the following architectures, or add a new entry to the Makefile:"
	@echo "    termcap curses"
	@echo "    irix irix6 aix solaris24 solaris25 osf1 linux"


#
# machine-specific targets
#

linux:  $(OBJ) 
	$(CC) $(LDFLAGS) -o lafe $(OBJ) -lreadline -lcurses 

# the Irix 6 target uses the -32 flag to be runnable on Irix5
irix6:
	CFLAGS='-g -I. -32 -mips1' LDFLAGS='-g -32 -mips1' make termcap

# should work on irix5 or irix6
irix:
	CFLAGS='-g -I.' LDFLAGS='-g' make termcap

# should work on AIX3 or AIX4, posixy
aix:
	CFLAGS='-g -I.' LDFLAGS='-g' make curses

# another posixy unix, note the vanilla flags.
osf1:
	CFLAGS='-g -I.' LDFLAGS='-g' make curses

# not so posixy, weird libraries
solaris24:
	CFLAGS='-g -I. -DHAVE_CONFIG_H' LDFLAGS='-g -lsocket -lnsl' make termcap

solaris25:
	CFLAGS='-g -I.' LDFLAGS='-g -lsocket -lnsl' make termcap

#
# Internal lafe targets, CFLAGS and LDFLAGS won't get set if you call these

termcap: configure $(OBJ) 
	cd readline ; make
	$(CC) $(LDFLAGS) -o lafe $(OBJ) -Lreadline -lreadline -ltermcap

curses: configure $(OBJ) 
	cd readline ; make
	$(CC) $(LDFLAGS) -o lafe $(OBJ) -Lreadline -lreadline -lcurses 


configure: readline/config.status

readline/config.status:
	cd readline ; CFLAGS='$(CFLAGS)' ./configure

clean:
	-rm -f readline/core lafe *.o lafe.tar.gz example.tar.gz

distclean: clean
	-cd readline ; make distclean

dist: distclean
	cd .. ; tar cf - lafe/Makefile lafe/lafe.c lafe/lafe.h lafe/alias.c lafe/parse.c lafe/history.c lafe/var.c lafe/game.c lafe/README lafe/ChangeLog lafe/TODO lafe/example lafe/readline | gzip -9 >lafe/lafe.tar.gz
	cd .. ; tar cf - lafe/README lafe/example | gzip -9 > lafe/example.tar.gz