# Makefile for indiserver, sample simulated drivers and other misc INDI tools.


# relative path to dir with special libraries
LIBROOT = .
LIBLILXML = ../liblilxml

# compiler and linker flags
CC = gcc
CLDFLAGS = -g
GCCFLAGS = -ffast-math -Wall
CFLAGS = $(CLDFLAGS) $(GCCFLAGS) -I$(LIBROOT)/libastro -I$(LIBLILXML)
LDFLAGS = $(CLDFLAGS) -L$(LIBROOT) -L$(LIBLILXML)
LIBS = -llilxml -lz -lm

# build everything
all: getINDI setINDI

getINDI: getINDI.o
	$(CC) $(LDFLAGS) -o $@ $? $(LIBS)

setINDI: setINDI.o
	$(CC) $(LDFLAGS) -o $@ $? $(LIBS)

install:	
	cp getINDI /usr/local/bin/
	cp setINDI /usr/local/bin/
	cp getINDI.1 /usr/local/man/man1/
	cp setINDI.1 /usr/local/man/man1/	

clean:
	touch x.o 
	rm -f *.o  x.err
	rm setINDI getINDI 
