all: libax25.a

CC = gcc
CFLAGS = -Wall -Wstrict-prototypes -O2

ifeq ($(strip $(ETC_DIR)),)
include ../Makefile.include
endif

# These are the paths in which the Library and Include files will be installed.
AXLIB_LIB = $(AXLIB_ROOT)/lib
AXLIB_INC = $(AXLIB_ROOT)/include/ax25

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $<

libax25.a: axutils.o axconfig.o daemon.o nrconfig.o procutils.o rsconfig.o ttyutils.o version.o
	ar rcs libax25.a axutils.o axconfig.o daemon.o nrconfig.o procutils.o rsconfig.o ttyutils.o version.o

clean:
	rm -f *.o *~ *.bak *.orig

distclean: clean
	rm -f libax25.a config.h

installlib: libax25.a
	install -m 644 -o root -g root libax25.a		$(AXLIB_LIB)
	install -m 755 -o root -g root -d			$(AXLIB_INC)
	install -m 644 -o root -g root *.h			$(AXLIB_INC)

axutils.o:	axutils.c axutils.h
axconfig.o:	axconfig.c axconfig.h axutils.h config.h
daemon.o:	daemon.c daemon.h
nrconfig.o:	nrconfig.c nrconfig.h config.h
procutils.o:	procutils.c procutils.h config.h
rsconfig.o:	rsconfig.c rsconfig.h config.h
ttyutils.o:	ttyutils.c ttyutils.h config.h
version.o:	version.c version.h

