LIB = libsensfloor DEMO = demosensfloor INSTALL_DIR = /usr/local CFLAGS = -Wall -I. -g LDFLAGS = INSTALL = install -c all: $(LIB).a $(LIB).so $(DEMO) $(LIB).a: $(LIB).o $(AR) rc $@ $^ $(LIB).so: $(LIB).c $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< $(DEMO): $(DEMO).o $(LIB).so clean: -rm -f *.o *~ proper: clean -rm -f $(LIB).a $(LIB).so $(DEMO) install: $(LIB).a $(LIB).so $(LIB).h $(INSTALL) -d $(INSTALL_DIR) $(INSTALL) -m 0755 -s $(LIB).so $(INSTALL_DIR)/lib/ $(INSTALL) -m 0644 -s $(LIB).a $(INSTALL_DIR)/lib/ $(INSTALL) -m 0644 $(LIB).h $(INSTALL_DIR)/include/ ldconfig $(INSTALL_DIR)/lib/ demo: all @echo " Try something like:" @echo 'LD_LIBRARY_PATH+=:. ./$(DEMO) -d /dev/ttyUSB0' @echo 'LD_LIBRARY_PATH+=:. ./$(DEMO) -s 192.168.5.5 -p 5000 -g 0x0355 -x 7 -y 8' @echo 'pv -L 80 -q ./floor.dump | LD_LIBRARY_PATH+=:. ./$(DEMO) -f -' Makefile.dep: $(LIB).c $(DEMO).c $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep .PHONY: all clean proper install demo svnignore svnignore: echo $(LIB).a $(LIB).so $(LIB).o $(DEMO).o $(DEMO) | tr ' ' '\012' > .svnignore svn propset svn:ignore -F .svnignore .