summaryrefslogtreecommitdiff
path: root/human68k/Makefile
blob: e50e429af04c23b89a0ff3b88263501f44ece6d2 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for human68k
# Written by NIIMI Satoshi <a01309@cfi.waseda.ac.jp>
#
# 1999/09/23: Modified by Shimazaki Ryo.

ifeq "$(TARGET)" "X68030"
COPT = -m68020-40
AOPT = -m68020 -sCPU020
LDFLAGS = -L/usr/local/lib/lib060
endif

VPATH = human68k

CC = gcc2
CFLAGS = $(COPT) -I. -Wall -O2 -fomit-frame-pointer -fstrength-reduce \
	 -DASM_CRC -D__DOS_INLINE__
#LDFLAGS = -Wl,-x
LIBS = -lhmem -lttyi -lsignal

AS = g2as
ASFLAGS = $(AOPT) -1 -c4 -y -w2

# object file lists
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
       human68k.o crc_68.o crctab.o
OBJI = deflate.o trees.o
OBJA =
OBJU = zipfile_.o fileio_.o util_.o globals.o human68k_.o
OBJN = zipnote.o  $(OBJU)
OBJC = zipcloak.o $(OBJU) crctab.o crypt_.o ttyio.o
OBJS = zipsplit.o $(OBJU)

ZIP_H = zip.h ziperr.h tailor.h human68k/osdep.h

all: zips

.SUFFIXES: _.o .o .c
.c_.o:
	$(CC) $(CFLAGS) -DUTIL -c $< -o $@
.c.o:
	$(CC) $(CFLAGS) -c $< -o $@

ZIPS = zip.x zipnote.x zipsplit.x zipcloak.x

zips: $(ZIPS)

zip.x: $(OBJZ) $(OBJI) $(OBJA)
	$(CC) $(LDFLAGS) -o $@ $(OBJZ) $(OBJI) $(OBJA) $(LIBS)
zipnote.x: $(OBJN)
	$(CC) $(LDFLAGS) -o $@ $(OBJN) $(LIBS)
zipcloak.x: $(OBJC)
	$(CC) $(LDFLAGS) -o $@ $(OBJC) $(LIBS)
zipsplit.x: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)


human68k.o: human68k/human68k.c
	$(CC) $(CFLAGS) -c -o $@ $<

human68k_.o: human68k/human68k.c
	$(CC) $(CFLAGS) -c -o $@ $< -DUTIL

#match.o: human68k/match.s
#	$(AS) $(ASFLAGS) -o $@ $<

deflate.o: human68k/deflate.s
	$(AS) $(ASFLAGS) -o $@ $<

crc_68.o: human68k/crc_68.s
	$(AS) $(ASFLAGS) -o $@ $<


clean:
	rm -f *.o $(ZIPS)

zip.bfd: $(ZIPS)
	rm -f $@
	for file in $(ZIPS); do \
		bdif -A -R uploaded/$$file $$file $@; \
	done

# rules for zip, zipnote, zipcloak, zipsplit.
$(OBJZ): $(ZIP_H)
$(OBJI): $(ZIP_H)
$(OBJN): $(ZIP_H)
$(OBJS): $(ZIP_H)
$(OBJC): $(ZIP_H)
zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
zipup.o: human68k/zipup.h

# EOF