# Make file for bystand
# Important: Ensure you are using a recent version of SQLite.

OBJS= bystand.o

# Link executable against shared sqlite library
# -s is omitted, see install rule
bystand: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -lsqlite3 -ldl -lpthread

# Install exeutable to ~/bin
# Symbol table is stripped after installation (similar to -s)
install: bystand
	cp bystand ~/bin/bystand
	strip ~/bin/bystand

# Delete object files and executable
clean:
	rm -f *.o
	rm -f bystand

# POSIX conformant inference rule (Source *.c => Object *.o)
# Should work with every make program
# Add debug symbols with -g
.c.o:
	$(CC) -g -O2 $(CFLAGS) $(CPPFLAGS) -c -o $@ $*.c

