From ec00fe6b2836794b36b4f9e6bd147f7864146b9d Mon Sep 17 00:00:00 2001 From: siemargl Date: Wed, 23 Nov 2016 11:15:33 +0000 Subject: [PATCH] base working version git-svn-id: svn://kolibrios.org@6745 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/fs/unzip60/kolibri/Makefile.gcc | 14 +- .../fs/unzip60/kolibri/Makefile.gcc.shared | 593 +++++++++++++++++ .../fs/unzip60/kolibri/Makefile.gcc.static | 598 ++++++++++++++++++ programs/fs/unzip60/kolibri/config.h | 4 +- programs/fs/unzip60/kolibri/kos32.c | 20 +- 5 files changed, 1215 insertions(+), 14 deletions(-) create mode 100644 programs/fs/unzip60/kolibri/Makefile.gcc.shared create mode 100644 programs/fs/unzip60/kolibri/Makefile.gcc.static diff --git a/programs/fs/unzip60/kolibri/Makefile.gcc b/programs/fs/unzip60/kolibri/Makefile.gcc index a0af8c4c54..7b92c3a049 100644 --- a/programs/fs/unzip60/kolibri/Makefile.gcc +++ b/programs/fs/unzip60/kolibri/Makefile.gcc @@ -19,6 +19,7 @@ SDK_DIR:= $(abspath ../../../contrib/sdk) NOASM=1 CC_CPU_OPT=-march=pentium +#USEZLIB=1 ### Optional section @@ -94,7 +95,7 @@ CC_ENVIR_OPT = -DWIN32 -DFORCE_WIN32_OVER_UNIX endif endif ### kolibri specific -INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include +INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib CC_ENVIR_OPT = -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DKOS32 \ @@ -152,15 +153,16 @@ CC_OUT_OPT = -o # Other specific options CC_SPECIFIC_OPT = -c $(CC_ENVIR_OPT) AS_SPECIFIC_OPT = -c -LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/lib/app-dynamic.lds \ +LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app-dynamic.lds \ --image-base 0 $(LIBPATH) # Libraries for the debug & release version # (GCC 2.95 and newer does not require the system library specifications) +# -lapp only for gcc 4.8 ifdef USEZLIB -LD_RELEASE_LIBS = -lz -lgcc -ldll -lc.dll +LD_RELEASE_LIBS = -lz -lgcc -ldll -lc.dll -lapp else -LD_RELEASE_LIBS = -lgcc -ldll -lc.dll +LD_RELEASE_LIBS = -lgcc -ldll -lc.dll -lapp endif LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) @@ -169,7 +171,7 @@ LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) # Suffixes OBJ = .o -EXE = .exe +EXE = . .SUFFIXES: .c .S $(OBJ) $(EXE) .PHONY: FORCE @@ -273,7 +275,7 @@ UNZIP_H = unzip.h unzpriv.h globals.h all: unzip$(EXE) unzip$(EXE): $(OBJU) $(LIBBZIP2) - $(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.exe.map + $(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.map kos32-objcopy $@ -O binary unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X) diff --git a/programs/fs/unzip60/kolibri/Makefile.gcc.shared b/programs/fs/unzip60/kolibri/Makefile.gcc.shared new file mode 100644 index 0000000000..0c9c4c1fe7 --- /dev/null +++ b/programs/fs/unzip60/kolibri/Makefile.gcc.shared @@ -0,0 +1,593 @@ +# Makefile for UnZip, fUnZip and UnZipSFX for native Win32-Intel ports of gcc. +# Currently supported implementations: Cygnus/Win32 and MinGW32. +# +# First version: Cosmin Truta, Dec 1997. +# Last revision: Christian Spieler, 09-Aug-2008. +# +# To use, do "make -f win32/makefile.gcc". + +# configuration switches supported: +# NOASM=1 disable assembler crc32 code, the generic C source code +# is used instead. +# NOCRC_OPT=1 disable "unfolding CRC tables" optimization. +# OPT_P6=1 add "modern gcc" tuning option for PentiumPro family CPU. +# USEBZ2=1 activate integrated compilation of bzip2 compression support, +# this requires the bzip2 sources present in the bzip2 subfolder. +# USEZLIB=1 replace internal deflate code by externally provided zlib. +# USE_POSIX=1 build posix-style binaries targeted for the CygWin unix +# emulation environment. +SDK_DIR:= $(abspath ../../../contrib/sdk) +NOASM=1 +CC_CPU_OPT=-march=pentium + +### still not work - EMFILE error +###USEZLIB=1 + +### Optional section + +# The following options allow to override the default assembler code usage +ifdef NOASM +APPLY_ASMCRC=0 +endif +ifdef USEASM +APPLY_ASMCRC=1 +endif + +# The external zlib library supplies its own crc32 implementation... +ifdef USEZLIB +APPLY_ASMCRC=0 +endif + +# default is ASM CRC code (from .S source) for now... +ifndef APPLY_ASMCRC +APPLY_ASMCRC=1 +endif + +# optional inclusion of bzip2 decompression +IZ_BZIP2 = bzip2 +ifdef USEBZ2 +INC_BZ2LIB = -I$(IZ_BZIP2) +LOCFLAGS = $(INC_BZ2LIB) -DUSE_BZIP2 +LD_BZ2LIB = -L$(IZ_BZIP2) -lbz2 +LIBBZIP2 = $(IZ_BZIP2)/libbz2.a +else +INC_BZ2LIB = +LOCFLAGS = +LD_BZ2LIB = +LIBBZIP2 = +endif +LIBBZIP2X = $(LIBBZIP2) + +ifndef USEZLIB + +# Apply the "CRC unfolding tables" optimization unless explicitly disabled. +# (This optimization might have negative effects on old CPU designs with a +# small first-level data cache.) +ifndef NOCRC_OPT +LOCFLAGS += -DIZ_CRCOPTIM_UNFOLDTBL +endif + +# Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE) +# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added +# to the declaration of LOCFLAGS here: +ifneq ($(APPLY_ASMCRC),0) +LOCFLAGS += -DASM_CRC +endif + +else # ifndef USEZLIB + +LOCFLAGS += -DUSE_ZLIB + +endif # ifndef USEZLIB ... else ... + +# Finally, append additional externally supplied options. +LOCFLAGS += $(LOCAL_UNZIP) + +# Some gcc distributions for Win32 (e.g. CygWin) try to emulate a POSIX- +# compatible (Unix-style) environment. This Makefile defaults to a +# "native Win32" build. To build POSIX-mode binaries, it is recommended +# to use the Makefile of the Unix port. However, by defining the variable +# "USE_POSIX", building binaries for the POSIX environment can be enabled +# here as well. +ifdef 0 +ifdef USE_POSIX +CC_ENVIR_OPT = -DUNIX -DFORCE_UNIX_OVER_WIN32 +else +CC_ENVIR_OPT = -DWIN32 -DFORCE_WIN32_OVER_UNIX +endif +endif +### kolibri specific +INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib +LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib + +CC_ENVIR_OPT = -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DKOS32 \ + $(INCLUDES) + +### Compiler-specific section + +# ------------ GNU C ------------ +CC = kos32-gcc + +#AS = as +AS = $(CC) + +LD = kos32-ld +###LD = $(CC) + +AR = ar + +###RC = windres + +# Quiet +CC_QUIET_OPT = +AS_QUIET_OPT = $(CC_QUIET_OPT) +LD_QUIET_OPT = $(CC_QUIET_OPT) + +# Warnings +CC_WARN_OPT = -Wall +AS_WARN_OPT = $(CC_WARN_OPT) +LD_WARN_OPT = + +# Debug version +CC_DEBUG_OPT = -g +AS_DEBUG_OPT = $(CC_DEBUG_OPT) +LD_DEBUG_OPT = $(CC_DEBUG_OPT) + +# Release version +CC_RELEASE_OPT = +AS_RELEASE_OPT = +LD_RELEASE_OPT = -s + +# Prefered target CPU (instruction scheduling optimized for...) +ifndef CC_CPU_OPT +CC_CPU_OPT = -mcpu=pentiumpro +endif + +# Smallest code (-Os is new since EGC 1.1, use -O1 for 2.8.1 and earlier) +CC_SIZE_OPT = -Os $(CC_CPU_OPT) + +# Fastest code +CC_SPEED_OPT = -O2 $(CC_CPU_OPT) + +# Output object file name +CC_OUT_OPT = -o + +# Other specific options +CC_SPECIFIC_OPT = -c $(CC_ENVIR_OPT) +AS_SPECIFIC_OPT = -c +LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app-dynamic.lds \ + --image-base 0 $(LIBPATH) + +# Libraries for the debug & release version +# (GCC 2.95 and newer does not require the system library specifications) +# -lapp only for gcc 4.8 +ifdef USEZLIB +LD_RELEASE_LIBS = -lz -lgcc -ldll -lc.dll -lapp +else +LD_RELEASE_LIBS = -lgcc -ldll -lc.dll -lapp +endif +LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) + + +### System-specific section + +# Suffixes +OBJ = .o +EXE = . + +.SUFFIXES: .c .S $(OBJ) $(EXE) +.PHONY: FORCE + +# Commands +RM = del /q + + +### General section + +CFLAGS = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \ + $(CC_OUT_OPT) $@ +ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS) +LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT) + +# To build with debug info, use 'make DEBUG=1'. +ifdef DEBUG +CVER = $(CC_DEBUG_OPT) +ASVER = $(AS_DEBUG_OPT) +LDVER = $(LD_DEBUG_OPT) +GENFLAGS = +FFLAGS = -DFUNZIP +SFXFLAGS = -DSFX +GENDLLFL = -DDLL -DWINDLL +GENGUILB = -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = -DSFX +GENLIBFL = -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_DEBUG_LIBS) +else +CVER = $(CC_RELEASE_OPT) +ASVER = $(AS_RELEASE_OPT) +LDVER = $(LD_RELEASE_OPT) +GENFLAGS = $(CC_SPEED_OPT) +FFLAGS = $(CC_SPEED_OPT) -DFUNZIP +SFXFLAGS = $(CC_SIZE_OPT) -DSFX +GENDLLFL = $(CC_SPEED_OPT) -DDLL -DWINDLL +GENGUILB = $(CC_SIZE_OPT) -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = $(CC_SIZE_OPT) -DSFX +GENLIBFL = $(CC_SPEED_OPT) -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_RELEASE_LIBS) +endif +GUILDFLAG=-mwindows + +# Object files +ifneq ($(APPLY_ASMCRC),0) +OBJA = crc_i386$(OBJ) +else +OBJA = +endif +OBJU1 = unzip$(OBJ) crc32$(OBJ) crypt$(OBJ) envargs$(OBJ) +OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) inflate$(OBJ) +OBJU3 = list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) ubz2err$(OBJ) +OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ) +OBJUS= kos32$(OBJ) dirent$(OBJ) +###OBJUS = win32$(OBJ) win32i64$(OBJ) nt$(OBJ) winapprc$(OBJ) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJA) $(OBJUS) +OBJX1 = unzipsfx$(OBJ) crc32x$(OBJ) cryptx$(OBJ) extractx$(OBJ) +OBJX2 = fileiox$(OBJ) globalsx$(OBJ) inflatex$(OBJ) matchx$(OBJ) processx$(OBJ) +OBJX3 = ttyiox$(OBJ) ubz2errx$(OBJ) +###OBJXS = win32x$(OBJ) win32i64x$(OBJ) ntx$(OBJ) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJA) $(OBJXS) +OBJF1 = funzip$(OBJ) crc32$(OBJ) cryptf$(OBJ) globalsf$(OBJ) inflatef$(OBJ) +OBJF2 = ttyiof$(OBJ) +###OBJFS = win32f$(OBJ) win32i64f$(OBJ) +OBJF = $(OBJF1) $(OBJF2) $(OBJA) $(OBJFS) +OBJDLL = windll$(OBJ) windllrc$(OBJ) api$(OBJ) +OBJD1 = crc32l$(OBJ) cryptl$(OBJ) +OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ) +OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ) ubz2errl$(OBJ) +OBJD4 = unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ) +###OBJDS = win32l$(OBJ) win32i64l$(OBJ) ntl$(OBJ) +OBJD = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJA) $(OBJDS) +OBLX1 = apig$(OBJ) crc32g$(OBJ) cryptg$(OBJ) +OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ) +OBLX3 = matchg$(OBJ) processg$(OBJ) ubz2errg$(OBJ) +###OBLXS = win32g$(OBJ) win32i64g$(OBJ) ntg$(OBJ) windllg$(OBJ) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBJA) $(OBLXS) +OBGX = sfxwiz$(OBJ) sfxwizrc$(OBJ) +OBJLIB = windllb$(OBJ) apib$(OBJ) +OBJB1 = crc32b$(OBJ) cryptb$(OBJ) +OBJB2 = explodeb$(OBJ) extractb$(OBJ) fileiob$(OBJ) globalsb$(OBJ) +OBJB3 = inflateb$(OBJ) listb$(OBJ) matchb$(OBJ) processb$(OBJ) ubz2errb$(OBJ) +OBJB4 = unreducb$(OBJ) unshrnkb$(OBJ) zipinfob$(OBJ) +###OBJBS = win32b$(OBJ) win32i64b$(OBJ) ntb$(OBJ) +OBJB = $(OBJLIB) $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJA) $(OBJBS) + +UNZIP_H = unzip.h unzpriv.h globals.h +###win32/w32cfg.h +###WINDLL_H = windll/windll.h windll/structs.h windll/decs.h +###DLLDEF = windll/windllgcc.def +###WINDLL_IMP_H = windll/decs.h windll/structs.h + + +# Default target is all the executables +###unzips: unzip$(EXE) funzip$(EXE) unzipsfx$(EXE) +###dll: unzip32.dll +###dllsample: uzexampl$(EXE) +###guisfx: SFXWiz32$(EXE) +#lib: libunzip32.a +###all: unzips dll dllsample guisfx lib +all: unzip$(EXE) + +unzip$(EXE): $(OBJU) $(LIBBZIP2) + $(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.map + kos32-objcopy $@ -O binary + +unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X) + $(LD) $(LDFLAGS) $(LDVER) $(OBJX) $(LDLIBS) + +funzip$(EXE): $(OBJF) + $(LD) $(LDFLAGS) $(LDVER) $(OBJF) $(LDLIBS) + +unzip32.dll: $(DLLDEF) $(OBJD) $(LIBBZIP2) + dllwrap --driver-name $(CC) --def $(DLLDEF) $(LDFLAGS) $(LDVER) $(OBJD) $(LD_BZ2LIB) $(LDLIBS) + +libunzsfx32.a: $(OBLX) + $(AR) -rus $@ $(OBLX) + +SFXWiz32$(EXE): $(OBGX) libunzsfx32.a $(LIBBZIP2X) + $(LD) $(GUILDFLAG) $(LDFLAGS) $(LDVER) $(OBGX) -L. -lunzsfx32 $(LDLIBS) + +uzexampl$(EXE): uzexampl$(OBJ) + $(CC) $(LDFLAGS) $(LDVER) uzexampl$(OBJ) -lversion $(LDLIBS) + +libunzip32.a: $(OBJB) + $(AR) -rus $@ $(OBJB) + + +# create/update the library for the optional bzip2 support: +$(IZ_BZIP2)/libbz2.a: FORCE + $(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz CC="$(CC)" RM="$(RM)" +FORCE: + +# How to compile sources +.c$(OBJ): + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $< +.S$(OBJ): + $(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $< + +# Dependencies +crc32$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h +crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h +envargs$(OBJ): envargs.c $(UNZIP_H) +explode$(OBJ): explode.c $(UNZIP_H) +extract$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h +fileio$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h +funzip$(OBJ): funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h +globals$(OBJ): globals.c $(UNZIP_H) +inflate$(OBJ): inflate.c inflate.h $(UNZIP_H) +list$(OBJ): list.c $(UNZIP_H) +match$(OBJ): match.c $(UNZIP_H) +process$(OBJ): process.c $(UNZIP_H) crc32.h +ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +ubz2err$(OBJ): ubz2err.c $(UNZIP_H) +unreduce$(OBJ): unreduce.c $(UNZIP_H) +unshrink$(OBJ): unshrink.c $(UNZIP_H) +unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo$(OBJ): zipinfo.c $(UNZIP_H) +crc_i386$(OBJ): crc_i386.S + + +kos32$(OBJ): kolibri/kos32.c kolibri/kos32sys1.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< +dirent$(OBJ): kolibri/dirent.c kolibri/kos32sys1.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< +###win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###win32i64$(OBJ): win32/win32i64.c $(UNZIP_H) +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###winapprc$(OBJ): win32/winapp.rc unzvers.h +### - $(RC) -o $@ $< + +# UnZipSFX compilation section +crc32x$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +cryptx$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +extractx$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +fileiox$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +globalsx$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +inflatex$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +matchx$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +processx$(OBJ): process.c $(UNZIP_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +ttyiox$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +ubz2errx$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +unzipsfx$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +win32x$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +win32i64x$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +ntx$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +# fUnZip compilation section +cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +globalsf$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $< + +win32i64f$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $< + +# WINDLL sample +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +# DLL compilation section +api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +crc32l$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +cryptl$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +explodel$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +extractl$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +fileiol$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +globalsl$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +inflatel$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +listl$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +matchl$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +processl$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +ubz2errl$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +unreducl$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +unshrnkl$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +zipinfol$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +win32i64l$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +windllrc$(OBJ): windll/windll.rc unzvers.h + - $(RC) -o $@ $< + +# SFX Lib compilation section +apig$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +crc32g$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +cryptg$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +extractg$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +fileiog$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +globalsg$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +inflateg$(OBJ): inflate.c inflate.h $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +matchg$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +processg$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +ubz2errg$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +win32g$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +win32i64g$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +ntg$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +windllg$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +sfxwiz$(OBJ): windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUISX) -I. $< + +sfxwizrc$(OBJ): windll/guisfx/sfxwiz.rc + - $(RC) --include-dir windll/guisfx --define WIN32 -o$@ $< + +# Static LIB compilation section +apib$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +crc32b$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +cryptb$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +explodeb$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +extractb$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +fileiob$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +globalsb$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +inflateb$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +listb$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +matchb$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +processb$(OBJ): process.c $(UNZIP_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +ubz2errb$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +unreducb$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +unshrnkb$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +zipinfob$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +win32b$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +win32i64b$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +ntb$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +windllb$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +clean: + -$(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz RM="$(RM)" clean + -$(RM) *$(OBJ) + -$(RM) unzip$(EXE) funzip$(EXE) unzipsfx$(EXE) + -$(RM) unzip32.dll uzexampl$(EXE) SFXWiz32$(EXE) + -$(RM) libunzip32.a libunzsfx32.a diff --git a/programs/fs/unzip60/kolibri/Makefile.gcc.static b/programs/fs/unzip60/kolibri/Makefile.gcc.static new file mode 100644 index 0000000000..a477625e9a --- /dev/null +++ b/programs/fs/unzip60/kolibri/Makefile.gcc.static @@ -0,0 +1,598 @@ +# Makefile for UnZip, fUnZip and UnZipSFX for native Win32-Intel ports of gcc. +# Currently supported implementations: Cygnus/Win32 and MinGW32. +# +# First version: Cosmin Truta, Dec 1997. +# Last revision: Christian Spieler, 09-Aug-2008. +# +# To use, do "make -f win32/makefile.gcc". + +# configuration switches supported: +# NOASM=1 disable assembler crc32 code, the generic C source code +# is used instead. +# NOCRC_OPT=1 disable "unfolding CRC tables" optimization. +# OPT_P6=1 add "modern gcc" tuning option for PentiumPro family CPU. +# USEBZ2=1 activate integrated compilation of bzip2 compression support, +# this requires the bzip2 sources present in the bzip2 subfolder. +# USEZLIB=1 replace internal deflate code by externally provided zlib. +# USE_POSIX=1 build posix-style binaries targeted for the CygWin unix +# emulation environment. +SDK_DIR:= $(abspath ../../../contrib/sdk) +NOASM=1 +CC_CPU_OPT=-march=pentium +## debug may lead to handle leak, so only 59 file max unziped +#DEBUG=1 + +### still not work - EMFILE error +###USEZLIB=1 + +### Optional section + +# The following options allow to override the default assembler code usage +ifdef NOASM +APPLY_ASMCRC=0 +endif +ifdef USEASM +APPLY_ASMCRC=1 +endif + +# The external zlib library supplies its own crc32 implementation... +ifdef USEZLIB +APPLY_ASMCRC=0 +endif + +# default is ASM CRC code (from .S source) for now... +ifndef APPLY_ASMCRC +APPLY_ASMCRC=1 +endif + +# optional inclusion of bzip2 decompression +IZ_BZIP2 = bzip2 +ifdef USEBZ2 +INC_BZ2LIB = -I$(IZ_BZIP2) +LOCFLAGS = $(INC_BZ2LIB) -DUSE_BZIP2 +LD_BZ2LIB = -L$(IZ_BZIP2) -lbz2 +LIBBZIP2 = $(IZ_BZIP2)/libbz2.a +else +INC_BZ2LIB = +LOCFLAGS = +LD_BZ2LIB = +LIBBZIP2 = +endif +LIBBZIP2X = $(LIBBZIP2) + +ifndef USEZLIB + +# Apply the "CRC unfolding tables" optimization unless explicitly disabled. +# (This optimization might have negative effects on old CPU designs with a +# small first-level data cache.) +ifndef NOCRC_OPT +LOCFLAGS += -DIZ_CRCOPTIM_UNFOLDTBL +endif + +# Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE) +# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added +# to the declaration of LOCFLAGS here: +ifneq ($(APPLY_ASMCRC),0) +LOCFLAGS += -DASM_CRC +endif + +else # ifndef USEZLIB + +LOCFLAGS += -DUSE_ZLIB + +endif # ifndef USEZLIB ... else ... + +# Finally, append additional externally supplied options. +LOCFLAGS += $(LOCAL_UNZIP) + +# Some gcc distributions for Win32 (e.g. CygWin) try to emulate a POSIX- +# compatible (Unix-style) environment. This Makefile defaults to a +# "native Win32" build. To build POSIX-mode binaries, it is recommended +# to use the Makefile of the Unix port. However, by defining the variable +# "USE_POSIX", building binaries for the POSIX environment can be enabled +# here as well. +ifdef 0 +ifdef USE_POSIX +CC_ENVIR_OPT = -DUNIX -DFORCE_UNIX_OVER_WIN32 +else +CC_ENVIR_OPT = -DWIN32 -DFORCE_WIN32_OVER_UNIX +endif +endif +### kolibri specific +INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib +LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib + +CC_ENVIR_OPT = -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DKOS32 \ + $(INCLUDES) -DSTATIC_LIBC + +### Compiler-specific section + +# ------------ GNU C ------------ +CC = kos32-gcc + +#AS = as +AS = $(CC) + +LD = kos32-ld +###LD = $(CC) + +AR = ar + +###RC = windres + +# Quiet +CC_QUIET_OPT = +AS_QUIET_OPT = $(CC_QUIET_OPT) +LD_QUIET_OPT = $(CC_QUIET_OPT) + +# Warnings +CC_WARN_OPT = -Wall +AS_WARN_OPT = $(CC_WARN_OPT) +LD_WARN_OPT = + +# Debug version +CC_DEBUG_OPT = -g -DDEBUG +AS_DEBUG_OPT = $(CC_DEBUG_OPT) +LD_DEBUG_OPT = -g + +# Release version +CC_RELEASE_OPT = +AS_RELEASE_OPT = +LD_RELEASE_OPT = -s + +# Prefered target CPU (instruction scheduling optimized for...) +ifndef CC_CPU_OPT +CC_CPU_OPT = -mcpu=pentiumpro +endif + +# Smallest code (-Os is new since EGC 1.1, use -O1 for 2.8.1 and earlier) +CC_SIZE_OPT = -Os $(CC_CPU_OPT) + +# Fastest code +CC_SPEED_OPT = -O2 $(CC_CPU_OPT) + +# Output object file name +CC_OUT_OPT = -o + +# Other specific options +CC_SPECIFIC_OPT = -c $(CC_ENVIR_OPT) +AS_SPECIFIC_OPT = -c +###LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app-dynamic.lds + +LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/static.lds \ + --image-base 0 $(LIBPATH) + +# Libraries for the debug & release version +# (GCC 2.95 and newer does not require the system library specifications) +# -lapp only for gcc 4.8 with newlib 2.2!!! +ifdef USEZLIB +---LD_RELEASE_LIBS = -lz -lgcc -ldll -lc.dll -lapp +else +##LD_RELEASE_LIBS = -lgcc -ldll -lc.dll -lapp +LD_RELEASE_LIBS = -lc -lgcc -lc +endif +LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) + + +### System-specific section + +# Suffixes +OBJ = .o +EXE = . + +.SUFFIXES: .c .S $(OBJ) $(EXE) +.PHONY: FORCE + +# Commands +RM = del /q + + +### General section + +CFLAGS = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \ + $(CC_OUT_OPT) $@ +ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS) +LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT) + +# To build with debug info, use 'make DEBUG=1'. +ifdef DEBUG +CVER = $(CC_DEBUG_OPT) +ASVER = $(AS_DEBUG_OPT) +LDVER = $(LD_DEBUG_OPT) +GENFLAGS = +FFLAGS = -DFUNZIP +SFXFLAGS = -DSFX +GENDLLFL = -DDLL -DWINDLL +GENGUILB = -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = -DSFX +GENLIBFL = -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_DEBUG_LIBS) +else +CVER = $(CC_RELEASE_OPT) +ASVER = $(AS_RELEASE_OPT) +LDVER = $(LD_RELEASE_OPT) +GENFLAGS = $(CC_SPEED_OPT) +FFLAGS = $(CC_SPEED_OPT) -DFUNZIP +SFXFLAGS = $(CC_SIZE_OPT) -DSFX +GENDLLFL = $(CC_SPEED_OPT) -DDLL -DWINDLL +GENGUILB = $(CC_SIZE_OPT) -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = $(CC_SIZE_OPT) -DSFX +GENLIBFL = $(CC_SPEED_OPT) -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_RELEASE_LIBS) +endif +GUILDFLAG=-mwindows + +# Object files +ifneq ($(APPLY_ASMCRC),0) +OBJA = crc_i386$(OBJ) +else +OBJA = +endif +OBJU1 = unzip$(OBJ) crc32$(OBJ) crypt$(OBJ) envargs$(OBJ) +OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) inflate$(OBJ) +OBJU3 = list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) ubz2err$(OBJ) +OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ) +OBJUS= kos32$(OBJ) dirent$(OBJ) +###OBJUS = win32$(OBJ) win32i64$(OBJ) nt$(OBJ) winapprc$(OBJ) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJA) $(OBJUS) +OBJX1 = unzipsfx$(OBJ) crc32x$(OBJ) cryptx$(OBJ) extractx$(OBJ) +OBJX2 = fileiox$(OBJ) globalsx$(OBJ) inflatex$(OBJ) matchx$(OBJ) processx$(OBJ) +OBJX3 = ttyiox$(OBJ) ubz2errx$(OBJ) +###OBJXS = win32x$(OBJ) win32i64x$(OBJ) ntx$(OBJ) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJA) $(OBJXS) +OBJF1 = funzip$(OBJ) crc32$(OBJ) cryptf$(OBJ) globalsf$(OBJ) inflatef$(OBJ) +OBJF2 = ttyiof$(OBJ) +###OBJFS = win32f$(OBJ) win32i64f$(OBJ) +OBJF = $(OBJF1) $(OBJF2) $(OBJA) $(OBJFS) +OBJDLL = windll$(OBJ) windllrc$(OBJ) api$(OBJ) +OBJD1 = crc32l$(OBJ) cryptl$(OBJ) +OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ) +OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ) ubz2errl$(OBJ) +OBJD4 = unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ) +###OBJDS = win32l$(OBJ) win32i64l$(OBJ) ntl$(OBJ) +OBJD = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJA) $(OBJDS) +OBLX1 = apig$(OBJ) crc32g$(OBJ) cryptg$(OBJ) +OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ) +OBLX3 = matchg$(OBJ) processg$(OBJ) ubz2errg$(OBJ) +###OBLXS = win32g$(OBJ) win32i64g$(OBJ) ntg$(OBJ) windllg$(OBJ) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBJA) $(OBLXS) +OBGX = sfxwiz$(OBJ) sfxwizrc$(OBJ) +OBJLIB = windllb$(OBJ) apib$(OBJ) +OBJB1 = crc32b$(OBJ) cryptb$(OBJ) +OBJB2 = explodeb$(OBJ) extractb$(OBJ) fileiob$(OBJ) globalsb$(OBJ) +OBJB3 = inflateb$(OBJ) listb$(OBJ) matchb$(OBJ) processb$(OBJ) ubz2errb$(OBJ) +OBJB4 = unreducb$(OBJ) unshrnkb$(OBJ) zipinfob$(OBJ) +###OBJBS = win32b$(OBJ) win32i64b$(OBJ) ntb$(OBJ) +OBJB = $(OBJLIB) $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJA) $(OBJBS) + +UNZIP_H = unzip.h unzpriv.h globals.h +###win32/w32cfg.h +###WINDLL_H = windll/windll.h windll/structs.h windll/decs.h +###DLLDEF = windll/windllgcc.def +###WINDLL_IMP_H = windll/decs.h windll/structs.h + + +# Default target is all the executables +###unzips: unzip$(EXE) funzip$(EXE) unzipsfx$(EXE) +###dll: unzip32.dll +###dllsample: uzexampl$(EXE) +###guisfx: SFXWiz32$(EXE) +#lib: libunzip32.a +###all: unzips dll dllsample guisfx lib +all: unzip$(EXE) + +unzip$(EXE): $(OBJU) $(LIBBZIP2) + $(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.map + kos32-objcopy $@ -O binary + +unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X) + $(LD) $(LDFLAGS) $(LDVER) $(OBJX) $(LDLIBS) + +funzip$(EXE): $(OBJF) + $(LD) $(LDFLAGS) $(LDVER) $(OBJF) $(LDLIBS) + +unzip32.dll: $(DLLDEF) $(OBJD) $(LIBBZIP2) + dllwrap --driver-name $(CC) --def $(DLLDEF) $(LDFLAGS) $(LDVER) $(OBJD) $(LD_BZ2LIB) $(LDLIBS) + +libunzsfx32.a: $(OBLX) + $(AR) -rus $@ $(OBLX) + +SFXWiz32$(EXE): $(OBGX) libunzsfx32.a $(LIBBZIP2X) + $(LD) $(GUILDFLAG) $(LDFLAGS) $(LDVER) $(OBGX) -L. -lunzsfx32 $(LDLIBS) + +uzexampl$(EXE): uzexampl$(OBJ) + $(CC) $(LDFLAGS) $(LDVER) uzexampl$(OBJ) -lversion $(LDLIBS) + +libunzip32.a: $(OBJB) + $(AR) -rus $@ $(OBJB) + + +# create/update the library for the optional bzip2 support: +$(IZ_BZIP2)/libbz2.a: FORCE + $(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz CC="$(CC)" RM="$(RM)" +FORCE: + +# How to compile sources +.c$(OBJ): + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $< +.S$(OBJ): + $(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $< + +# Dependencies +crc32$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h +crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h +envargs$(OBJ): envargs.c $(UNZIP_H) +explode$(OBJ): explode.c $(UNZIP_H) +extract$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h +fileio$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h +funzip$(OBJ): funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h +globals$(OBJ): globals.c $(UNZIP_H) +inflate$(OBJ): inflate.c inflate.h $(UNZIP_H) +list$(OBJ): list.c $(UNZIP_H) +match$(OBJ): match.c $(UNZIP_H) +process$(OBJ): process.c $(UNZIP_H) crc32.h +ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +ubz2err$(OBJ): ubz2err.c $(UNZIP_H) +unreduce$(OBJ): unreduce.c $(UNZIP_H) +unshrink$(OBJ): unshrink.c $(UNZIP_H) +unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo$(OBJ): zipinfo.c $(UNZIP_H) +crc_i386$(OBJ): crc_i386.S + + +kos32$(OBJ): kolibri/kos32.c kolibri/kos32sys1.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< +dirent$(OBJ): kolibri/dirent.c kolibri/kos32sys1.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< +###win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###win32i64$(OBJ): win32/win32i64.c $(UNZIP_H) +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h +### $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +###winapprc$(OBJ): win32/winapp.rc unzvers.h +### - $(RC) -o $@ $< + +# UnZipSFX compilation section +crc32x$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +cryptx$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +extractx$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +fileiox$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +globalsx$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +inflatex$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +matchx$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +processx$(OBJ): process.c $(UNZIP_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +ttyiox$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +ubz2errx$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +unzipsfx$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $< + +win32x$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +win32i64x$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +ntx$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $< + +# fUnZip compilation section +cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +globalsf$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) $< + +win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $< + +win32i64f$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $< + +# WINDLL sample +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $< + +# DLL compilation section +api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +crc32l$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +cryptl$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +explodel$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +extractl$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +fileiol$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +globalsl$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +inflatel$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +listl$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +matchl$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +processl$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +ubz2errl$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +unreducl$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +unshrnkl$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +zipinfol$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $< + +win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +win32i64l$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $< + +windllrc$(OBJ): windll/windll.rc unzvers.h + - $(RC) -o $@ $< + +# SFX Lib compilation section +apig$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +crc32g$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +cryptg$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +extractg$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +fileiog$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +globalsg$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +inflateg$(OBJ): inflate.c inflate.h $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +matchg$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +processg$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +ubz2errg$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) $< + +win32g$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +win32i64g$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +ntg$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +windllg$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $< + +sfxwiz$(OBJ): windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUISX) -I. $< + +sfxwizrc$(OBJ): windll/guisfx/sfxwiz.rc + - $(RC) --include-dir windll/guisfx --define WIN32 -o$@ $< + +# Static LIB compilation section +apib$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +crc32b$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +cryptb$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +explodeb$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +extractb$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +fileiob$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +globalsb$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +inflateb$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +listb$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +matchb$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +processb$(OBJ): process.c $(UNZIP_H) crc32.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +ubz2errb$(OBJ): ubz2err.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +unreducb$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +unshrnkb$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +zipinfob$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $< + +win32b$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +win32i64b$(OBJ): win32/win32i64.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +ntb$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +windllb$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $< + +clean: + -$(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz RM="$(RM)" clean + -$(RM) *$(OBJ) + -$(RM) unzip$(EXE) funzip$(EXE) unzipsfx$(EXE) + -$(RM) unzip32.dll uzexampl$(EXE) SFXWiz32$(EXE) + -$(RM) libunzip32.a libunzsfx32.a diff --git a/programs/fs/unzip60/kolibri/config.h b/programs/fs/unzip60/kolibri/config.h index 211a3cb5c9..694b167926 100644 --- a/programs/fs/unzip60/kolibri/config.h +++ b/programs/fs/unzip60/kolibri/config.h @@ -13,8 +13,8 @@ Started by Siemargl @Nov 2016 #include #include - -#define DEBUG +// moved to makefile, in kilibri leads to bug EMFILES +//#define DEBUG #define DIR_END '/' #define NO_STRNICMP diff --git a/programs/fs/unzip60/kolibri/kos32.c b/programs/fs/unzip60/kolibri/kos32.c index a87efe165d..429de3c1aa 100644 --- a/programs/fs/unzip60/kolibri/kos32.c +++ b/programs/fs/unzip60/kolibri/kos32.c @@ -11,14 +11,21 @@ go in unzip60 directory (below this file) and Contains: version() mapattr() + mapname() checkdir() + close_outfile() + get_extattribs() + do_wild() -extract.o:extract.c:(.text+0x1410): undefined reference to `mapname' -extract.o:extract.c:(.text+0x241d): undefined reference to `close_outfile' -extract.o:extract.c:(.text+0x2e09): undefined reference to `checkdir' -process.o:process.c:(.text+0x13e9): undefined reference to `checkdir' -process.o:process.c:(.text+0x15a1): undefined reference to `do_wild' -kolibri\makefile.gcc:276: recipe for target 'unzip.exe' failed +todo + russian filenames in arh + datetime restore + overwrite request not in stderr + + too many open files error EMFILE when DEBUG - error in newlib open. fixed + -d dir error. Use -ddir or -d dir/ + + release, sizing removing old compression methods or zlib */ #define FATTR FS_HIDDEN+FS_SYSTEM+FS_SUBDIR @@ -770,6 +777,7 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */ #if (defined(NO_FCHOWN)) fclose(G.outfile); + Trace((stdout, "File (%s) closed\n", FnFilter1(G.filename))); #endif // kos. add set file datetime ?