SubDir HAIKU_TOP src bin gawk ;

SetSubDirSupportedPlatformsBeOSCompatible ;

# filter warnings we don't want here
TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS)
	: -Wall -Wmissing-prototypes -Wsign-compare ] ;

SubDirCcFlags -DDEFPATH='\".:/share/awk\"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='\"/share/locale\"' ;

SubDirSysHdrs $(SUBDIR) ;
SubDirSysHdrs [ FDirName $(SUBDIR) intl ] ;

local gawk_rsrc = [ FGristFiles gawk.rsrc ] ;
ResComp $(gawk_rsrc) : [ FGristFiles gawk.rdef ] ;

local common_files =
	array.c awkgram.c builtin.c ext.c field.c
	gawkmisc.c getopt.c getopt1.c io.c
	main.c msg.c node.c random.c re.c
	regex.c replace.c version.c
	;

Objects $(common_files) ;

BinCommand gawk :
	[ FGristFiles $(common_files:S=.o) ] eval.c profile.c
	:  <gawk>libintl.a
	: gawk.rsrc ;

BinCommand pgawk :
	[ FGristFiles $(common_files:S=.o) ] eval_p.c profile_p.c
	:  <gawk>libintl.a
	: gawk.rsrc ;

SubInclude HAIKU_TOP src bin gawk intl ;
