#  
LIBNAME=libconio.lib

#     h -> hS
HSFILES=conio_const.hS

# 
OFILES= conio_s.rel conio.rel conio_var.rel  koi8r-8x8.rel io.rel

#  
all: $(HSFILES) $(OFILES)
	$(CCLIB) a $(LIBNAME) *.rel


#   
main.rel:
	$(CC) -c $(COPTS) main.c

%.rel:%.c
	$(CC) -c $(COPTS) $<

%.rel:%.s
	$(AS) -l -s -o $@ $<

%.hS:%.h
	s2hs $< $@

#  
crt0.s: templates/crt0.s_tmpl
	ga_abs $< $@ $(CLOC) $(SSIZE)

# 
clean: 
	rm -f *.lib *.lst *.sym *.exp *.bin *.map *.mem *.lnk *.ihx *.rel *.rst *.asm *.bin crt0.s *.rel
	rm -f  *.hS *.\$$C
# 

