| 1 |
###################################################################### |
| 2 |
# |
| 3 |
# Makefile for Info-ZIP's zip, zipcloak, zipnote, and zipsplit on AtheOS |
| 4 |
# |
| 5 |
# Copyright (C) 1999-2007 Info-ZIP |
| 6 |
# Chris Herborth ([email protected]) |
| 7 |
# Ruslan Nickolaev ([email protected]) |
| 8 |
# |
| 9 |
###################################################################### |
| 10 |
# Things that don't change: |
| 11 |
|
| 12 |
# Punish people who don't have SMP hardware. |
| 13 |
MAKE = make -j 4 -f atheos/Makefile |
| 14 |
SHELL = /bin/sh |
| 15 |
|
| 16 |
LN = ln -s |
| 17 |
RM = rm -f |
| 18 |
|
| 19 |
BIND = $(CC) |
| 20 |
AS = as |
| 21 |
|
| 22 |
INSTALL = install |
| 23 |
|
| 24 |
# Target directories |
| 25 |
prefix = /usr |
| 26 |
BINDIR = $(prefix)/bin |
| 27 |
manext = 1 |
| 28 |
MANDIR = $(prefix)/man/man$(manext) |
| 29 |
ZIPMANUAL = MANUAL |
| 30 |
|
| 31 |
VERSION = Version 2.3 of __DATE__ |
| 32 |
|
| 33 |
###################################################################### |
| 34 |
|
| 35 |
CC:=gcc |
| 36 |
CFLAGS:=-O3 -march=i586 -Wall -I. -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN -DASMV -DASM_CRC |
| 37 |
LFLAGS1:= |
| 38 |
LFLAGS2:= |
| 39 |
TARGET=$(ZIPS) |
| 40 |
|
| 41 |
###################################################################### |
| 42 |
# Helpful targets |
| 43 |
all: |
| 44 |
$(MAKE) CC=$(CC) CFLAGS="$(CFLAGS)" \ |
| 45 |
LFLAGS1="$(LFLAGS1)" LFLAGS2="$(LFLAGS2)" \ |
| 46 |
$(TARGET) |
| 47 |
|
| 48 |
###################################################################### |
| 49 |
# Object file lists and other build goodies |
| 50 |
|
| 51 |
# Object file lists |
| 52 |
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crc32.o crypt.o \ |
| 53 |
ttyio.o atheos.o |
| 54 |
OBJI = deflate.o trees.o |
| 55 |
OBJA = match.o crc_i386.o |
| 56 |
OBJU = zipfile_.o fileio_.o util_.o globals.o atheos_.o |
| 57 |
OBJN = zipnote.o $(OBJU) |
| 58 |
OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o |
| 59 |
OBJS = zipsplit.o $(OBJU) |
| 60 |
|
| 61 |
# Headers |
| 62 |
ZIP_H = zip.h ziperr.h tailor.h atheos/osdep.h |
| 63 |
|
| 64 |
# What to build? |
| 65 |
ZIPS = zip zipnote zipsplit zipcloak |
| 66 |
|
| 67 |
# suffix rules |
| 68 |
.SUFFIXES: |
| 69 |
.SUFFIXES: _.o .o .c .doc .1 |
| 70 |
.c_.o: |
| 71 |
$(RM) $*_.c; $(LN) $< $*_.c |
| 72 |
$(CC) -c $(CFLAGS) -DUTIL $*_.c |
| 73 |
$(RM) $*_.c |
| 74 |
|
| 75 |
.c.o: |
| 76 |
$(CC) -c $(CFLAGS) $< |
| 77 |
|
| 78 |
.1.doc: |
| 79 |
groff -man -Tascii $< > $@ |
| 80 |
|
| 81 |
# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL. |
| 82 |
$(OBJZ): $(ZIP_H) |
| 83 |
$(OBJI): $(ZIP_H) |
| 84 |
$(OBJN): $(ZIP_H) |
| 85 |
$(OBJS): $(ZIP_H) |
| 86 |
$(OBJC): $(ZIP_H) |
| 87 |
zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h |
| 88 |
zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h |
| 89 |
zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h |
| 90 |
zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h |
| 91 |
zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h |
| 92 |
zipup.o: atheos/zipup.h |
| 93 |
|
| 94 |
match.o: match.S |
| 95 |
$(CC) -E match.S > matchs.s |
| 96 |
$(AS) -o $@ matchs.s |
| 97 |
$(RM) matchs.s |
| 98 |
|
| 99 |
crc_i386.o: crc_i386.S |
| 100 |
$(CC) -E crc_i386.S > crc_i386s.s |
| 101 |
$(AS) -o $@ crc_i386s.s |
| 102 |
$(RM) crc_i386s.s |
| 103 |
|
| 104 |
atheos.o: atheos/atheos.c |
| 105 |
$(CC) -c $(CFLAGS) atheos/atheos.c |
| 106 |
|
| 107 |
atheos_.o: atheos/atheos.c |
| 108 |
$(RM) $*_.c; $(LN) atheos/atheos.c $*_.c |
| 109 |
$(CC) -c $(CFLAGS) -DUTIL $*_.c |
| 110 |
$(RM) $*_.c |
| 111 |
|
| 112 |
zips: $(ZIPS) |
| 113 |
zipsman: $(ZIPS) $(ZIPMANUAL) |
| 114 |
|
| 115 |
zip: $(OBJZ) $(OBJI) $(OBJA) |
| 116 |
$(BIND) -o zip $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) |
| 117 |
zipnote: $(OBJN) |
| 118 |
$(BIND) -o zipnote $(LFLAGS1) $(OBJN) $(LFLAGS2) |
| 119 |
zipcloak: $(OBJC) |
| 120 |
$(BIND) -o zipcloak $(LFLAGS1) $(OBJC) $(LFLAGS2) |
| 121 |
zipsplit: $(OBJS) |
| 122 |
$(BIND) -o zipsplit $(LFLAGS1) $(OBJS) $(LFLAGS2) |
| 123 |
|
| 124 |
$(ZIPMANUAL): man/zip.1 |
| 125 |
groff -man -Tascii man/zip.1 > $(ZIPMANUAL) |
| 126 |
|
| 127 |
# install |
| 128 |
install: $(ZIPS) |
| 129 |
$(INSTALL) -m755 $(ZIPS) $(BINDIR) |
| 130 |
mkdir -p $(MANDIR) |
| 131 |
$(INSTALL) -m644 man/zip.1 $(MANDIR)/zip.$(manext) |
| 132 |
|
| 133 |
uninstall: |
| 134 |
-cd $(BINDIR); $(RM) $(ZIPS) |
| 135 |
-cd $(MANDIR); $(RM) zip.$(manext) |
| 136 |
|
| 137 |
dist: $(ZIPMANUAL) |
| 138 |
zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \ |
| 139 |
-e s/[.]//g -e q revision.h` \ |
| 140 |
`awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents` |
| 141 |
|
| 142 |
# clean up after making stuff and installing it |
| 143 |
clean: |
| 144 |
$(RM) *.o $(ZIPS) flags |
| 145 |
|
| 146 |
# end of Makefile |