1
2# --------------------------------------------------------------
3#
4# Makefile[.templ]
5#
6# This file is the Makefile [template].
7# The real Makefile will be produced from Makefile.templ.
8# To aquire it, run ./configure
9#
10# --------------------------------------------------------------
11
12# system specific definitions
13
14SYSDEFS 		= -DUNIX %%%endian%%%
15
16# additional CFLAGS
17CFLAGS=-Wall -Wstrict-prototypes -pedantic -ansi
18
19# System prefixes (conditional)
20%%%prefix-setup%%%
21
22# unix dependent
23
24INCPATH              = -I/usr/include -I/usr/include/glide -I$(X11BASE)/include -I/usr/include/X11
25LIBPATH 	     = -L$(X11BASE)/lib
26
27LIBS 		     = 	%%%pthread%%% -lX11 %%%libext%%% %%%libsocket%%% \
28			%%%libnsl%%% %%%LIBXV%%%
29
30GLIDELIB             = -lglide2x -lm
31
32RELOBJS=z80.o gameboy.o sgb.o debug.o unix.o sound.o arplay.o \
33        settings.o main.o
34DEBOBJS=z80.do gameboy.do sgb.do debug.do unix.do arplay.do \
35        settings.do main.do
36
37OTHERFILES=Makefile GNUmakefile Makefile.pre conftest \
38	cingb cingb_deb cingb_glide \
39	cingb.log cingb_conf *~
40GLIDEOBJS=z80.go gameboy.go sgb.go debug.go unix.go sound.go arplay.go \
41          settings.go main.go
42
43CONFOBJS=settings.o confjoystick.o
44
45# Warnings
46
47WARN = -Wall -Wstrict-prototypes
48
49
50# Optimization
51
52OPTMZ = -O2
53#OPTMZ = -O6 -fomit-frame-pointer
54#OPTMZ = -g
55
56
57SWITCHES=$(CFLAGS) $(SYSDEFS) $(INCPATH) $(WARN) $(OPTMZ)
58.SUFFIXES: .c .o .do .go
59
60# Definitions: (#ifdef's)
61#
62# DEBUG       - includes debugger and special messages
63# VERBOSE     - some additional messages
64# JOYSTICK    - enables the joystick/-pad support
65# FRAMEBUFFER - enables the framebuffer device support
66
67DEVS            = %%%joystick%%% %%%framebuffer%%% -DDIALOGLINK
68GLOBALDEF 	= -DVERBOSE $(DEVS) %%%mitshm%%% %%%XVDEF%%% %%%OSDEF%%%
69DEBUGF 		= -DDEBUG $(GLOBALDEF)
70RELF   		= $(GLOBALDEF) %%%sound%%%
71GLIDEF          = -DGLIDE %%%joystick%%% %%%sound%%%
72
73
74standard: $(RELOBJS) %%%joyconf%%%
75	  $(CC) -o cingb $(LIBPATH) $(OPTMZ) $(RELOBJS) $(LIBS)
76
77debug: $(DEBOBJS) %%%joyconf%%%
78	$(CC) -o cingb_deb $(LIBPATH) $(DEBOBJS) $(LIBS)
79
80glide:  $(GLIDEOBJS) %%%joyconf%%%
81	$(CC) -o cingb_glide $(LIBPATH) $(OPTMZ) $(GLIDEOBJS) $(LIBS) $(GLIDELIB)
82
83conf:   $(CONFOBJS)
84	$(CC) -o cingb_conf $(CONFOBJS)
85
86install:
87	install -m 755 -s ./cingb $(PREFIX)/bin/cingb
88	%%%joyinst%%%
89
90clean:
91	rm -f $(RELOBJS) $(DEBOBJS) $(GLIDEOBJS) $(OTHERFILES) $(CONFOBJS)
92
93.c.o:
94	$(CC) -c $(SWITCHES) $(RELF) -o $@ $<
95
96.c.do:
97	$(CC) -c $(SWITCHES) $(DEBUGF) -o $@ $<
98
99.c.go:
100	$(CC) -c $(SWITCHES) $(GLIDEF) -o $@ $<
101
102z80.c:      globals.h z80.h z80opc.h gameboy.h sys.h debug.h
103
104gameboy.c:  globals.h z80.h z80opc.h gameboy.h sys.h sound.h
105
106debug.c:    globals.h z80.h debug.h gameboy.h
107
108unix.c:     globals.h z80.h gameboy.h sys.h sound.h joypad.h
109
110arplay.c: globals.h arplay.h
111
112settings.c: globals.h settings.h
113
114main.c:     globals.h z80.h gameboy.h
115