summaryrefslogtreecommitdiff
path: root/theos/Makefile
blob: acdbb12d33ac3b857afeeb4a766ed6ebddc3c3c5 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for
# THEOS ANSI C
# To use, do "make -f theos/makefile"
# This make file uses cl, a C compiler and linker driver written by
# Jean-Michel Dubois. Send a mail to jmdubois@ibcfrance.fr to get it for free.
# MAINWA_BUG    Workaround argument expansion failure
# LOCATE_BUG    Workaround stat, fopen and open failure on relative paths to
#               root dir.

CC=cl
CFLAGS=-Zi -W3 -DDYN_ALLOC -DCRYPT -DMAINWA_BUG -DLOCATE_BUG
LD=cl -o
LDFLAGS=-m -Zi
AS=cc
ASFLAGS=

UTILFLAGS=-DUTIL $(CFLAGS) -Fo

# variables

# object file lists
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
       theos.o crc32.o _fprintf.o _stat.o _chmod.o _isatty.o \
       _setargv.o _rename.o
OBJI = deflate.o trees.o
OBJA =
OBJU = zipfile_.o fileio_.o util_.o globals.o theos_.o _rename.o _stat.o \
       _chmod.o _fprintf.o
OBJN = zipnote.o  $(OBJU)
OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o
OBJS = zipsplit.o $(OBJU)

OSDEP_H = theos/osdep.h
ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H)

ZIPS = zip.command zipnote.command zipsplit.command zipcloak.command

zips:	$(ZIPS)

zip.o:	zip.c $(ZIP_H) crc32.h crypt.h ttyio.h revision.h
	$(CC) -c $(CFLAGS) $*.c

zipfile.o:	zipfile.c $(ZIP_H) crc32.h
	$(CC) -c $(CFLAGS) $*.c

zipup.o:	zipup.c $(ZIP_H) revision.h crc32.h crypt.h
	$(CC) -c $(CFLAGS) $*.c

fileio.o:	fileio.c $(ZIP_H) crc32.h
	$(CC) -c $(CFLAGS) $*.c

util.o:	util.c $(ZIP_H) theos/charconv.h
	$(CC) -c $(CFLAGS) $*.c

globals.o:	globals.c $(ZIP_H)
	$(CC) -c $(CFLAGS) $*.c

crc32.o:	crc32.c $(ZIP_H) crc32.h
	$(CC) -c $(CFLAGS) $*.c

deflate.o:	deflate.c $(ZIP_H)
	$(CC) -c $(CFLAGS) $*.c

trees.o:	trees.c $(ZIP_H)
	$(CC) -c $(CFLAGS) $*.c

crypt.o:	crypt.c $(ZIP_H) crc32.h crypt.h
	$(CC) -c $(CFLAGS) $*.c

theos.o:	theos/theos.c $(ZIP_H)
	$(CC) -c $(CFLAGS) -Fo$@ theos/theos.c

_fprintf.o:	theos/_fprintf.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_fprintf.c

_stat.o:	theos/_stat.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_stat.c

_chmod.o:	theos/_chmod.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_chmod.c

_isatty.o:	theos/_isatty.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_isatty.c

_rename.o:	theos/_rename.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_rename.c

_setargv.o:	theos/_setargv.c
	$(CC) -c $(CFLAGS) -Fo$@ theos/_setargv.c

ttyio.o:	$(ZIP_H) ttyio.h ttyio.c
	$(CC) -c $(CFLAGS) $*.c

zipcloak.o:	zipcloak.c $(ZIP_H) crc32.h crypt.h ttyio.h revision.h
	$(CC) -c $(CFLAGS) $*.c

zipnote.o:	zipnote.c $(ZIP_H) revision.h
	$(CC) -c $(CFLAGS) $*.c

zipsplit.o:	$(ZIP_H) revision.h
	$(CC) -c $(CFLAGS) $*.c

zipfile_.o:	zipfile.c $(ZIP_H) crc32.h
	$(CC) -c $(UTILFLAGS)$@ zipfile.c

fileio_.o:	fileio.c $(ZIP_H) crc32.h
	$(CC) -c $(UTILFLAGS)$@ fileio.c

theos_.o:	theos/theos.c $(ZIP_H)
	$(CC) -c $(UTILFLAGS)$@ theos/theos.c

util_.o:	util.c $(ZIP_H)
	$(CC) -c $(UTILFLAGS)$@ util.c

crc32_.o:	crc32.c $(ZIP_H) crc32.h
	$(CC) -c $(UTILFLAGS)$@ $*.c

crypt_.o:	crypt.c $(ZIP_H) crc32.h crypt.h
	$(CC) -c $(UTILFLAGS)$@ crypt.c

zip.command: $(OBJZ) $(OBJI)
	$(LD) $@ $(OBJZ) $(OBJI) $(LDFLAGS)

zipcloak.command: $(OBJC)
	$(LD) $@ $(OBJC) $(LDFLAGS)

zipnote.command: $(OBJN)
	$(LD) $@ $(OBJN) $(LDFLAGS)

zipsplit.command: $(OBJS)
	$(LD) $@ $(OBJS) $(LDFLAGS)

install:	$(ZIPS)
	copy *.command /system.cmd32.=(rep noq not

clean:
	erase *.o(noq not
	erase *.command(noq not