📄 makefile
字号:
######################################################################## Makefile for Info-ZIP's unzip, unzipsfx, and funzip on AtheOS# Version 5.52## Copyright (C) 1998-2001 Info-ZIP# Chris Herborth (chrish@qnx.com)# Copyright (C) 2004 Nikolaev Ruslan (nruslan@hotbox.ru)## To automatically install the fresh new unzip, use the "install" target:# make -f atheos/Makefile install######################################################################SHELL = /bin/bash# Punish those of you not running on SMP hardware...MAKE = make -j 4 -f atheos/Makefile# UnZipSFX flagsSL = -o unzipsfxSL2 = $(LF2)# fUnZip flagsFL = -o funzipFL2 = $(LF2)# general-purpose stuffCP = cpAS = asRM = rm -fLN = ln -sfCHMOD = chmodE =O = .oM = atheosOSDEP_H = atheos/athcfg.h# define# object filesOBJS1 = unzip$O crc_i386$O crctab$O crypt$O envargs$O explode$OOBJS2 = extract$O fileio$O globals$O inflate$O list$O match$OOBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$OOBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$OLOBJS = $(OBJS)OBJSDLL = $(OBJS) api$OOBJX = unzipsfx$O crc_i386$O crctab_$O crypt_$O extract_$O fileio_$O globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$OLOBJX = $(OBJX)OBJF = funzip$O crc_i386$O cryptf$O globalsf$O inflatef$O ttyiof$OUNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)# installationINSTALL = installmanext = 1prefix = /usrBINDIR = $(prefix)/binMANDIR = $(prefix)/man/man$(manext)INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/zipinfo$E $(BINDIR)/unzipsfx$E $(BINDIR)/unzip$EINSTALLEDMAN = $(MANDIR)/unzip.$(manext) $(MANDIR)/funzip.$(manext) $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipinfo.$(manext)#UNZIPS = unzip$E funzip$E unzipsfx$E zipinfo$E# this is a little ugly...well, no, it's a lot ugly:MANS = man/unzip.1 man/unzipsfx.1 man/zipinfo.1 man/funzip.1 man/zipgrep.1######################################################################CC=gccLD=gccCF=-O3 -march=i586 -Wall -I. -DPASSWD_FROM_STDIN -DASM_CRC -DUSE_UNSHRINK $(LOCAL_UNZIP)LF=-o unzipLF2=TARGET=$(UNZIPS)####################################################################### Helpful targetsall: @echo 'TARGET = $(TARGET)' @echo 'CC = $(CC)' if [ -n "$(TARGET)" ] ; then \ $(MAKE) CC=$(CC) CF="$(CF)" LD="$(LD)" \ LF="$(LF)" LF2="$(LF2)" CCPP="$(CC)" CPPF="$(CF)" \ OBJS="$(OBJS)" LOBJS="$(LOBJS)" OBJX="$(OBJX)" \ LOBJX="$(LOBJX)" $(TARGET) ; \ else \ $(MAKE) help ; \ fihelp: @echo '' @echo "This Makefile lets you build Info-ZIP's zip." @echo '' @echo 'To build zip for this computer using the default compiler, just do:' @echo '' @echo ' make -f atheos/Makefile' @echo ''####################################################################### Basic compile instructions and dependencies# this is for GNU make; comment out and notify zip-bugs if it causes errors.SUFFIXES: .c .o# default for compiling C files.c.o: $(CC) -c $(CF) $*.cunzips: $(UNZIPS)objs: $(OBJS)objsdll: $(OBJSDLL)unzipsman: unzipsunzip$E: $(OBJS) $(LD) $(LF) $(LOBJS) $(LF2) $(CHMOD) +x unzip$Eunzipsfx$E: $(OBJX) $(LD) $(SL) $(LOBJX) $(SL2) $(CHMOD) +x unzipsfx$Efunzip$E: $(OBJF) $(LD) $(FL) $(OBJF) $(FL2) $(CHMOD) +x funzip$Ezipinfo$E: unzip$E $(LN) unzip$E zipinfo$Ecrctab$O: crctab.c $(UNZIP_H) zip.hcrypt$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.henvargs$O: envargs.c $(UNZIP_H)explode$O: explode.c $(UNZIP_H)extract$O: extract.c $(UNZIP_H) crypt.hfileio$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.hfunzip$O: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.hglobals$O: globals.c $(UNZIP_H)inflate$O: inflate.c inflate.h $(UNZIP_H)list$O: list.c $(UNZIP_H)match$O: match.c $(UNZIP_H)process$O: process.c $(UNZIP_H)ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.hunreduce$O: unreduce.c $(UNZIP_H)unshrink$O: unshrink.c $(UNZIP_H)unzip$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.hzipinfo$O: zipinfo.c $(UNZIP_H)crc_i386$O: crc_i386.S $(CC) -E crc_i386.S > crc_i386s.s $(AS) -o $@ crc_i386s.s $(RM) crc_i386s.sunzipsfx$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only $(CP) unzip.c unzipsfx.c $(CC) -c $(CF) -DSFX unzipsfx.c $(RM) unzipsfx.cmatch_$O: match.c # unzipsfx only $(CP) match.c match_.c $(CC) -c $(CF) -DSFX match_.c $(RM) match_.ccrypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only $(CP) crypt.c crypt_.c $(CC) -c $(CF) -DSFX crypt_.c $(RM) crypt_.ccrctab_$O: crctab.c $(UNZIP_H) zip.h # unzipsfx only $(CP) crctab.c crctab_.c $(CC) -c $(CF) -DSFX crctab_.c $(RM) crctab_.cfileio_$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only $(CP) fileio.c fileio_.c $(CC) -c $(CF) -DSFX fileio_.c $(RM) fileio_.cextract_$O: extract.c $(UNZIP_H) crypt.h # unzipsfx only $(CP) extract.c extract_.c $(CC) -c $(CF) -DSFX extract_.c $(RM) extract_.cglobals_$O: globals.c $(UNZIP_H) # unzipsfx only $(CP) globals.c globals_.c $(CC) -c $(CF) -DSFX globals_.c $(RM) globals_.cinflate_$O: inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only $(CP) inflate.c inflate_.c $(CC) -c $(CF) -DSFX inflate_.c $(RM) inflate_.cprocess_$O: process.c $(UNZIP_H) # unzipsfx only $(CP) process.c process_.c $(CC) -c $(CF) -DSFX process_.c $(RM) process_.cttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only $(CP) ttyio.c ttyio_.c $(CC) -c $(CF) -DSFX ttyio_.c $(RM) ttyio_.ccryptf$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CP) crypt.c cryptf.c $(CC) -c $(CF) -DFUNZIP cryptf.c $(RM) cryptf.cglobalsf$O: globals.c $(UNZIP_H) # funzip only $(CP) globals.c globalsf.c $(CC) -c $(CF) -DFUNZIP globalsf.c $(RM) globalsf.cinflatef$O: inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only $(CP) inflate.c inflatef.c $(CC) -c $(CF) -DFUNZIP inflatef.c $(RM) inflatef.cttyiof$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only $(CP) ttyio.c ttyiof.c $(CC) -c $(CF) -DFUNZIP ttyiof.c $(RM) ttyiof.catheos$O: atheos/atheos.c $(UNZIP_H) unzvers.h atheos/atheos.h # AtheOS only $(CC) -c $(CF) atheos/atheos.c# version() not used by unzipsfx, so no unzvers.h dependencyatheos_$O: atheos/atheos.c $(UNZIP_H) atheos/atheos.h # unzipsfx only $(CP) atheos/atheos.c atheos_.c $(CC) -c $(CF) -Iatheos -DSFX atheos_.c $(RM) atheos_.c# this really only works for Unix targets, unless E and O specified on cmd lineclean: $(RM) $(UNZIPS) $(OBJS) $(OBJF) $(OBJX) api$O apihelp$O crc_gcc$O unzipstb$Oinstall: all $(INSTALL) -m 755 $(UNZIPS) $(BINDIR) $(RM) $(BINDIR)/zipinfo$E $(LN) unzip$E $(BINDIR)/zipinfo$E $(RM) $(BINDIR)/zipgrep$E $(INSTALL) -m 755 unix/zipgrep $(BINDIR)/zipgrep$E $(INSTALL) -m 644 man/unzip.1 $(MANDIR)/unzip.$(manext) $(INSTALL) -m 644 man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext) $(INSTALL) -m 644 man/zipinfo.1 $(MANDIR)/zipinfo.$(manext) $(INSTALL) -m 644 man/funzip.1 $(MANDIR)/funzip.$(manext) $(INSTALL) -m 644 man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)# alternatively, could use zip method: -cd $(BINDIR); $(RM) $(UNZIPS) [etc.]uninstall: $(RM) $(INSTALLEDBIN) $(INSTALLEDMAN)TESTZIP = testmake.zip # the test zipfile# test some basic features of the buildtest: checkcheck: @echo '##### This is a Unix-specific target. (Just so you know.)' @echo '##### Make sure unzip, funzip and unzipsfx are compiled and' @echo '##### in this directory.' @if test ! -f ./unzip; then \ echo "##### ERROR: can't find ./unzip"; exit 1; fi @if test ! -f ./funzip; then \ echo "##### ERROR: can't find ./funzip"; exit 1; fi @if test ! -f ./unzipsfx; then \ echo "##### ERROR: can't find ./unzipsfx"; exit 1; fi# @if test ! -f $(TESTZIP); then \ echo "##### ERROR: can't find test file $(TESTZIP)"; exit 1; fi# @echo "##### testing extraction" @./unzip -bo $(TESTZIP) testmake.zipinfo @if test ! -f testmake.zipinfo ; then \ echo "##### ERROR: file extraction from $(TESTZIP) failed"; \ exit 1; fi# @echo '##### testing zipinfo (unzip -Z)' @./unzip -Z $(TESTZIP) > testmake.unzip-Z @if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \ echo "##### WARNING: zipinfo output doesn't match stored version"; \ echo '##### (If the only difference is the file times, compare your'; \ echo '##### timezone with the Central European timezone, which is one'; \ echo '##### hour east of Greenwich but effectively 2 hours east'; \ echo '##### during summer Daylight Savings Time. The upper two'; \ echo '##### lines should correspond to your local time when the'; \ echo '##### files were created, on 19 November 1998 at 10:46pm CET.'; \ echo '##### If the times are consistent, please ignore this warning.)'; \ fi @$(RM) testmake.unzip-Z testmake.zipinfo# @echo '##### testing unzip -d exdir option' @./unzip -bo $(TESTZIP) -d testun notes @cat testun/notes# @echo '##### testing unzip -o and funzip (ignore funzip warning)' @./unzip -boq $(TESTZIP) notes -d testun @./funzip < $(TESTZIP) > testun/notes2 @if diff testun/notes testun/notes2; then true; else \ echo '##### ERROR: funzip output disagrees with unzip'; fi# @echo '##### testing unzipsfx (self-extractor)' @cat unzipsfx $(TESTZIP) > testsfx @$(CHMOD) 0700 testsfx @./testsfx -bo notes @if diff notes testun/notes; then true; else \ echo '##### ERROR: unzipsfx file disagrees with unzip'; fi @$(RM) testsfx notes testun/notes testun/notes2 @rmdir testun# @echo '##### testing complete.'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -