include ../config
export LC_ALL=C
CFLAGS+=-O3 -s 
#PROGRAMS=getch mkkeydef  bin2byte
PROGRAMS=bin2byte
EXEPROGRAMS= $(patsubst %,%$(EXEEXT),$(PROGRAMS))

UTILSDIR=$(CONFDIR)/utils
LIBS= $(USENCURSESLIB)
LOADLIBES= $(USENCURSESLIB)
all: $(PROGRAMS)

bin2byte: bin2byte.c
	$(GCC)  $(CFLAGS) $< -o $@ 
mkkeydef: mkkeydef.c
	$(GCC)  $(CFLAGS) $< -o $@ $(LIBS)
#keyconfig: keyconfig.c
#	$(GXX) $(CFLAGS) $< -o $@ $(LIBS)
getch.o: getch.c
	$(GXX) -c -DHAS_BOOL -D_GNU_SOURCE -DCURSES $(CFLAGS) $< -o $@
%.i:%.c;
	$(GCC) $(CFLAGS) -E $< -o $@ 
realclean: clean
clean:
	-rm	$(EXEPROGRAMS) core

install: $(PROGRAMS)
	-mkdir -p $(ROOTDIR)$(UTILSDIR)
ifneq ($(CYGWIN),yes)
	cp  $(PROGRAMS) $(ROOTDIR)$(UTILSDIR)
else
	cp  bin2byte.exe $(ROOTDIR)$(UTILSDIR)
endif
