SubDir HAIKU_TOP src tools unzip ;

SubDirCcFlags -std=c99 ;

SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin unzip ] ;

DEFINES += NO_CRYPT HAS_JUNK_EXTRA_FIELD_OPTION=1 ;
if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
	DEFINES += HAVE_TERMIOS_H=1 ;
}

# avoid building host unzip with DEBUG, as that would pollute the build
# with lots of unwanted output when unzip gets invoked.
DEBUG = 0 ;

USES_BE_API on <build>libunzip.a <build>unzip = true ;

BuildPlatformStaticLibrary <build>libunzip.a :
	crc32.c
	ttyio.c
	crctab.c
	envargs.c
	explode.c
	extract.c
	fileio.c
	globals.c
	inflate.c
	list.c
	match.c
	process.c
	zipinfo.c
	beos.c
	beosmain.cpp
;

BuildPlatformMain <build>unzip :
	unzip.c
	unreduce.c
	unshrink.c
	: <build>libunzip.a $(HOST_LIBBE) $(HOST_LIBSUPC++)
;
