summaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: fc1ade447ec54c96d20438c214bc6b6c1ebc5ebb (plain)
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
#
# Makefile for the ABC80 emulator
#

top_srcdir      = @top_srcdir@
srcdir          = @srcdir@
VPATH           = @srcdir@
prefix          = @prefix@
exec_prefix     = @exec_prefix@
bindir          = @bindir@
mandir          = @mandir@
datarootdir     = @datarootdir@

CC		= @CC@
CFLAGS		= @CFLAGS@
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

MKDIR		= mkdir
PERL		= perl
RM_F		= rm -f

# For Windows/MinGW use obj and .exe
O		= @OBJEXT@
X		= @EXEEXT@

GENO = abcrom40.$(O) abcrom80.$(O) ufddos.$(O) printrom.$(O)
GENC = abcrom40.c abcrom80.c ufddos.c printrom.c

OBJS = abc80.$(O) clock.$(O) sdlscrn.$(O) z80.$(O) abc80_mem.$(O) io.$(O) \
       abcfont.$(O) disk.$(O) \
       abcprint.$(O) print.$(O) fileop.$(O) \
       z80dis.$(O) $(GENO)
SRCS = abc80.c clock.c sdlscrn.c z80.c abc80_mem.c io.c \
       abcfont.c disk.c \
       abcprint.c print.c fileop.c \
       z80dis.c abcrom40.c abcrom80.c $(GENC)
HDRS = clock.h screen.h z80.h patchlevel.h

.SUFFIXES: .c .h .$(O) .bin

all: abc80

install: abc80$(X)
	$(MKDIR) -p $(INSTALLROOT)$(bindir)
	$(INSTALL_PROGRAM) abc80$(X) $(INSTALLROOT)$(bindir)
	$(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
	$(INSTALL_DATA) abc80.man $(INSTALLROOT)$(mandir)/man1/abc80.1

abc80$(X): $(OBJS)
	$(CC) $(LDFLAGS) -o abc80$(X) $(OBJS) $(LIBS)

.bin.c:
	$(PERL) bin2c.pl $< > $@ || ( rm -f $@ ; false )

abcrom40.c: abcrom40.bin bin2c.pl
abcrom80.c: abcrom80.bin bin2c.pl
printrom.c: printrom.bin bin2c.pl
ufddos.c: ufddos.bin bin2c.pl

printrom.bin: printrom.asm
	z80asm/z80asm -l printrom.lst -o printrom.bin printrom.asm

abc80.$(O):        clock.h screen.h z80.h patchlevel.h
clock.$(O):        clock.h z80.h
sdlscrn.$(O):       screen.h z80.h
z80.$(O):          z80.h


clean:
	$(RM_F) abc80$(X) *.$(O) *~ core *.lst
	$(RM_F) $(GENC)