Archive-Unzip-Burst
view release on metacpan or search on metacpan
unzip-6.0/unix/Makefile view on Meta::CPAN
#==============================================================================
# Makefile for UnZip, UnZipSFX and fUnZip: Unix and MS-DOS ("real" makes only)
# Version: 6.0 18 Jan 2009
#==============================================================================
# INSTRUCTIONS (such as they are):
#
# "make sunos" -- makes UnZip in current directory on a generic SunOS 4.x Sun
# "make list" -- lists all supported systems (targets)
# "make help" -- provides pointers on what targets to try if problems occur
# "make wombat" -- chokes and dies if you haven't added the specifics for your
# Wombat 68000 (or whatever) to the systems list
#
# CF are flags for the C compiler. LF are flags for the loader. LF2 are more
# flags for the loader, if they need to be at the end of the line instead of at
# the beginning (for example, some libraries). FL and FL2 are the corre-
# sponding flags for fUnZip. LOCAL_UNZIP is an environment variable that can
# be used to add default C flags to your compile without editing the Makefile
# (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C).
#
# Some versions of make do not define the macro "$(MAKE)"; this is rare, but
# if things don't work, try using "make" instead of "$(MAKE)" in your system's
# makerule. Or try adding the following line to your .login file:
# setenv MAKE "make"
# (That never works--makes that are too stupid to define MAKE are also too
# stupid to look in the environment--but try it anyway for kicks. :-) )
#
# Memcpy and memset are provided for those systems that don't have them; they
# are in fileio.c and will be used if -DZMEM is included in CF. These days
# almost all systems have them.
#
# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful compila-
# tion does not always imply a working program.
#####################
# MACRO DEFINITIONS #
#####################
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
# such as -DDOSWILD).
# UnZip flags
CC = cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol: ___main" is possible)
AS = as
LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
AF = $(LOC)
CFLAGS = -O
CF_NOOPT = -I. -I$(IZ_BZIP2) -DUNIX $(LOC)
CF = $(CFLAGS) $(CF_NOOPT)
LFLAGS1 =
LF = -o unzip$E $(LFLAGS1)
LF2 = -s
# UnZipSFX flags
SL = -o unzipsfx$E $(LFLAGS1)
SL2 = $(LF2)
# fUnZip flags
FL = -o funzip$E $(LFLAGS1)
FL2 = $(LF2)
# general-purpose stuff
#CP = cp
CP = ln
LN = ln
RM = rm -f
CHMOD = chmod
BINPERMS = 755
MANPERMS = 644
STRIP = strip
E =
O = .o
M = unix
SHELL = /bin/sh
MAKEF = -f unix/Makefile
# Version info for unix/unix.c
HOST_VERSINFO=-DIZ_CC_NAME='\"\$$(CC) \"' -DIZ_OS_NAME='\"`uname -a`\"'
# defaults for crc32 stuff and system dependent headers
CRCA_O =
OSDEP_H = unix/unxcfg.h
unzip-6.0/unix/Makefile view on Meta::CPAN
@echo '##### testing complete.'
################################
# INDIVIDUAL MACHINE MAKERULES #
################################
#----------------------------------------------------------------------------
# Generic targets using the configure script to determine configuration.
#----------------------------------------------------------------------------
# Well, try MAKE and see. By now everyone may be happy. 10/28/04 EG
generic: flags # now try autoconfigure first
eval $(MAKE) $(MAKEF) unzips ACONF_DEP=flags `cat flags`
# make $(MAKEF) unzips CF="${CF} `cat flags`"
generic_gcc:
$(MAKE) $(MAKEF) generic CC=gcc IZ_BZIP2="$(IZ_BZIP2)"
# extensions to perform SVR4 package-creation after compilation
generic_pkg: generic svr4package
generic_gccpkg: generic_gcc svr4package
#----------------------------------------------------------------------------
# Old static generic targets (can't assume make utility groks "$(MAKE)")
#----------------------------------------------------------------------------
generic1: unzips # first try if unknown
generic2: unix_make # second try if unknown: hope make is called "make"
make $(MAKEF) unzips CF="$(CF) -DBSD"
generic3: unix_make # third try if unknown: hope make is called "make"
make $(MAKEF) unzips CF="$(CF) -DSYSV"
# Generic build including bzip2 decompression support for unzip.
# Requires presence of the bzip2 sources in subdirectory bzip2.
generic_bz2: unix_make
@echo\
"This target assumes bzip2 sources are available in subfolder bzip2/."
$(MAKE) $(MAKEF) unzips D_USE_BZ2="-DUSE_BZIP2"\
L_BZ2="-lbz2" LIBBZ2="$(IZ_OUR_BZIP2_DIR)/libbz2.a" \
CC_BZ="$(CC)" CFLAGS_BZ="$(CFLAGS)"
# Generic unzip and funzip target using either shared or static zlib for
# inflate rather than the original UnZip version. (libz was libgz prior
# to 0.94) Need to figure out how to force unzipsfx to use static libz.
generic_zlib: unix_make
@echo\
"This target assumes zlib (libz.a or libz.so.*) is already installed."
$(MAKE) unzip funzip CF="$(CF) -DUSE_ZLIB" LF2="-lz $(LF2)"
# Generic GNU C shared library. This is an example of how to compile UnZip as
# a shared library. (Doing so as a static library would be similar.) See also
# the linux_shlib target.
generic_shlib: unix_make
@echo\
'This target requires GNU C. When done, do "setenv LD_LIBRARY_PATH `pwd`"'
@echo\
'or similar in order to test the shared library in place (with ./unzip_shlib ,'
@echo\
'which is UnZip linked with the DLL). This target is an example only.'
@echo ""
$(MAKE) objsdll CC=gcc CFLAGS="-O3 -Wall -fPIC -DDLL"
gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)
$(RM) libunzip.so.0 libunzip.so
$(LN) -s libunzip.so.0.4 libunzip.so.0
$(LN) -s libunzip.so.0 libunzip.so
gcc -c -O unzipstb.c
gcc -o unzip_shlib unzipstb.o -L. -lunzip
#----------------------------------------------------------------------------
# "Autoconfig" group, aliases for the generic targets using configure:
#----------------------------------------------------------------------------
# Solaris: generic, plus generation of installable package.
solaris_pkg: generic_pkg
# Solaris: forcing usage of GCC, plus generation of installable package.
solaris_gccpkg: generic_gcc_pkg
#----------------------------------------------------------------------------
# "Normal" group (BSD vs. SysV may be set in unzip.h via predefined macros):
#----------------------------------------------------------------------------
386i: unzips # sun386i, SunOS 4.0.2
#3Bx: unzips # AT&T 3B2/1000-80; should work on any WE32XXX machine
#aix_rt: unzips # IBM RT 6150 under AIX 2.2.1
bull: unzips # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch)
convex: unzips # Convex C-120 and C-210 (-O is enough; -ext is default)
cray: unzips # Cray-2 and Y-MP, using default (possibly old) compiler
dec: unzips # DEC 5820 (MIPS RISC), test version of Ultrix v4.0
encore: unzips # Multimax
eta: unzips # ETA-10P*, hybrid SysV with BSD 4.3 enhancements
gould: unzips # Gould PN9000 running UTX/32 2.1Bu01
hp: unzips # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D
hpux: unzips # (to match zip's makefile entry)
mips: unzips # MIPS M120-5(?), SysV.3 [error in sys/param.h file?]
next10: unzips # NeXT (generic; use next2x or next3x for better opt.)
osf1: unzips # DECstation, including Alpha-based; DEC OSF/1 v1.x
pyr_: unzips # [failsafe target for pyramid target below]
pyr_ucb: unzips # Pyramids running BSD universe by default (see below)
realix: unzips # Modcomp Real/IX (SysV.3); note "gcc" = GLS C, not GNU
sco: unzips # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
sgi: unzips # Silicon Graphics; Irix 3.3.2, 4.0.x, 5.2, etc.
stellar: unzips # gs-2000
sun: unzips # old target; no good with solaris...use "sunos" now
sunos: unzips # no good with SunOS 3.x...use "sunos3" or "sunos4" now
sunos4: unzips # Sun 3, 4; SunOS 4.x (SOME SYSTEMS ARE SYSTEM V!)
tahoe: unzips # tahoe (CCI Power6/32), 4.3BSD
ultrix: unzips # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.x
vax: unzips # general-purpose VAX target (not counting VMS)
#----------------------------------------------------------------------------
# BSD group (for timezone structs [struct timeb]):
#----------------------------------------------------------------------------
bsd: _bsd # generic BSD (BSD 4.2 & Ultrix handled in unzip.h)
unzip-6.0/unix/Makefile view on Meta::CPAN
$(MAKE) unzips CC="gcc" LD="gcc"\
LF="-n $(LF)" SL="-n $(SL)" FL="-n $(FL)"\
CFLAGS="-ga -X138 -Dlocaltime=localti -Dtimezone=timezon"
# ISC Unix on 386 platform
isc: unix_make
$(MAKE) unzips LF2="-lc_s $(LF2)" CRCA_O=crc_sysv$O \
CFLAGS="-O" LOC="-DASM_CRC -DSYSV -DNO_UID_GID -DNEED_PTEM -DNO_LCHOWN -DNO_LCHMOD $(LOC)" \
AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
isc_gcc: unix_make
$(MAKE) unzips AS=gcc CC=gcc LD=gcc CRCA_O=crc_gcc$O \
LF="-shlib $(LF)" SL="-shlib $(SL)" FL="-shlib $(FL)" LF2="" \
CFLAGS="-O3" LOC="-DSYSV -DASM_CRC -DNO_UID_GID -DNEED_PTEM -DNO_LCHOWN -DNO_LCHMOD $(LOC)" \
AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
$(STRIP) $(UNZIPS)
# "ISI machine (68025 CPU)" (based on e-mail from Rob White <rsw@tfs.com>;
# no further information). May also need DIRENT defined.
isi: unix_make
$(MAKE) unzips CF="$(CF) -DDECLARE_ERRNO -DNO_LCHOWN -DNO_LCHMOD"
# Linux on 386 platform, using the assembler replacement for crc32.c. (-O4 and
# -fno-strength-reduce have virtually no effect beyond -O3. Add "-m486
# -malign-functions=2 -malign-jumps=2 -malign-loops=2" for Pentium [Pro]
# systems.)
linux: unix_make
@echo 'NOTE: use linux_noasm target for non-Intel Linux compiles.'
$(MAKE) unzips CC=gcc LD=gcc AS=gcc\
CFLAGS="-O3 -Wall -DASM_CRC"\
AF="-Di386 $(AF)" CRCA_O=crc_gcc$O
# GRR: this echo is pointless; if user gets this far, no difference to install
# @echo 'Be sure to use the install_asm target rather than the install target'
linux_asm: linux
# Linux (Posix, approximately SysV): virtually any version since before 0.96,
# for any platform. Change "-O" to "-O3" or whatever, as desired...
linux_noasm: unix_make
$(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O -Wall"
# Linux with lcc compiler: __inline__ (stat.h) not recognized, and must edit
# /usr/include/gnu/types.h to get rid of "long long" if __LCC__ defined. -O3
# (or -O2 or -O) is ignored. [GRR 960828: test target only]
#
linux_lcc: unix_make
$(MAKE) unzips CC=lcc LD=lcc CFLAGS="-O3 -Wall -D__inline__= "
# Linux host with go32 (djgpp) cross-compiler (go32crs.tgz) for 32-bit DOS.
linux_dos: unix_make
$(MAKE) unzips CC=go32gcc LD=go32gcc M=msdos OSDEP_H="msdos/doscfg.h" \
CFLAGS="-O2 -Wall"
# go32-strip unzip
# Due to limitations of the cross-compiling package, this has to be
# done manually:
@echo Copy $(UNZIPS) to your DOS partition and use coff2exe.
# Linux ELF shared library (ooo, it's so easy). This is a test target for
# now, and it only makes the UnZip/ZipInfo stuff (not fUnZip or UnZipSFX).
# The version number may eventually change to match the UnZip version. Or
# not. Whatever. Also do "setenv LD_LIBRARY_PATH `pwd`" or similar to test
# the DLL in place (with unzip_shlib, which is UnZip linked with the shared
# library).
#
linux_shlib: unix_make
$(MAKE) objsdll CC=gcc CFLAGS="-O3 -Wall -fPIC"\
LOC="-DDLL -DASM_CRC $(LOC)"\
AS=gcc AF="-fPIC -Di386 $(AF)" CRCA_O=crc_gcc$O
gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)\
crc_gcc.pic.o
ln -sf libunzip.so.0.4 libunzip.so.0
ln -sf libunzip.so.0 libunzip.so
gcc -c -O unzipstb.c
gcc -o unzip_shlib unzipstb.o -L. -lunzip
# Linux ELF shared library, as above, but using inflate() from zlib (libz.so)
# instead of the original UnZip version. (libz was libgz prior to 0.94)
linux_shlibz: unix_make
$(MAKE) objsdll CC=gcc AS=gcc AF="-fPIC -Di386 $(AF)" CRCA_O=crc_gcc$O\
CFLAGS="-O3 -Wall -fPIC" LOC="-DDLL -DUSE_ZLIB -DASM_CRC $(LOC)"
gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)\
crc_gcc.pic.o
ln -sf libunzip.so.0.4 libunzip.so.0
gcc -c -O unzipstb.c
gcc -o unzip unzipstb.o -L. -lunzip -lz
# LynxOS-x86 2.3.0 and newer, a real-time BSD-like OS; uses gcc.
lynx: unix_make
$(MAKE) unzips CC=gcc CF="$(CF) -DLynx -DLYNX -DBSD -DUNIX"
# Macintosh MacOS X (Unix-compatible enviroment), using standard compiler
macosx: unix_make
$(MAKE) unzips CFLAGS="-O3 -Wall -DBSD" LF2=""
$(STRIP) $(UNZIPS)
# Macintosh MacOS X (Unix-compatible enviroment), using gcc
macosx_gcc: unix_make
$(MAKE) unzips CC=gcc CFLAGS="-O3 -Wall -DBSD" LF2=""
$(STRIP) $(UNZIPS)
# Minix 1.5 PC for the 386. Invoke as is to use default cc, or as "make
# minix CC=gcc" to use gcc. Try "make linux" if you have a working termios.h.
minix: unix_make
$(MAKE) unzips CF="$(CF) -DMINIX -DSHORT_NAMES -DNO_LCHOWN -DNO_LCHMOD" CC=$(CC) LD=$(CC)
# MPE/iX, the Unix variant for HP 3000 systems.
mpeix: unix_make
$(MAKE) unzips CC=c89\
CF="$(CF) -DUNIX -D_POSIX_SOURCE -DHAVE_TERMIOS_H -DPASSWD_FROM_STDIN -DNO_PARAM_H -DNO_LCHOWN -DNO_LCHMOD"\
LF2=-lbsd CP=cp LN="ln -s"
# NeXT info.
next:
@echo
@echo\
' Please pick a specific NeXT target: "make next10" will create a generic'
@echo\
' NeXT executable; "make next2x" will create a smaller executable (for'
@echo\
' NeXTstep 2.0 and higher); "make next3x" will create a small executable'
@echo\
( run in 3.035 seconds using v1.01-cache-2.11-cpan-98e64b0badf )