NASM = nasm
LD = ld
CFLAGS = -f elf64

EXAMPLES = send multi_send status select outbox latest latest_outbox \
           count_outbox count_inbox inbox inbox_paged receive status_by_number \
           user_credit user_details user_register phonebook_list phonebook_numbers \
           phonebook_create phonebook_delete phonebook_add phonebook_remove \
           blocked_list blocked_add blocked_remove blocked_exists

all: $(EXAMPLES)

%: examples/%.asm
	$(NASM) -f elf64 $< -o $@.o
	$(LD) $@.o -o $@

clean:
	rm -f *.o $(EXAMPLES)

.PHONY: all clean