LIB_OPTS=-g -Wall
CC=gcc
AR=ar

LIB_OBJS=ln_get_groups.o ln_get_group_summary.o ln_get_message_text.o \
	ln_create_header.o ln_mark_read.o ln_toggle_request.o ln_open_server.o \
   ln_update_group.o ln_sort_spool.o ln_thread_spool.o ln_post_messages.o \
	ln_convert_date.o ln_pack_spool.o ln_expire_spool.o ln_add_group.o \
	ln_get_list.o ln_add_folder.o

libnews.a: $(LIB_OBJS)
	$(AR) -crus libnews.a $(LIB_OBJS)

ln_get_groups.o: ln_get_groups.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_get_groups.c

ln_get_group_summary.o: ln_get_group_summary.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_get_group_summary.c

ln_get_message_text.o: ln_get_message_text.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_get_message_text.c

ln_create_header.o: ln_create_header.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_create_header.c 

ln_mark_read.o: ln_mark_read.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_mark_read.c

ln_toggle_request.o: ln_toggle_request.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_toggle_request.c

ln_open_server.o: ln_open_server.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_open_server.c

ln_update_group.o: ln_update_group.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_update_group.c

ln_sort_spool.o: ln_sort_spool.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_sort_spool.c

ln_thread_spool.o: ln_thread_spool.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_thread_spool.c

ln_post_messages.o: ln_post_messages.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_post_messages.c

ln_convert_date.o: ln_convert_date.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_convert_date.c 

ln_pack_spool.o: ln_pack_spool.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_pack_spool.c

ln_expire_spool.o: ln_expire_spool.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_expire_spool.c

ln_add_group.o: ln_add_group.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_add_group.c

ln_get_list.o: ln_get_list.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_get_list.c

ln_add_folder.o: ln_add_folder.c libnews.h
	$(CC) $(LIB_OPTS) -c ln_add_folder.c

# phony

.PHONY: clean
clean:
	rm -f *.bak *~ *.o *.a tags TAGS core

.PHONY: ctags
ctags:
	ctags *.c *.h

.PHONY: etags
etags:
	etags *.c *.h
