INSTALL_LOCATION=/usr/local .c.o : cc -I . -c $< all: hello-world-c hello-world-c: hello-world.o libhello_world.so cc -o $@ hello-world.o -L. -lhello_world libhello_world.so: libhello_world.c libhello_world.h cc -o $@ -shared libhello_world.c install: hello-world-install hello-world-install: mkdir -p $(INSTALL_LOCATION)/bin cp hello-world-c $(INSTALL_LOCATION)/bin chmod 755 $(INSTALL_LOCATION)/bin/hello-world-c mkdir -p $(INSTALL_LOCATION)/lib cp libhello_world.so $(INSTALL_LOCATION)/lib mkdir -p $(INSTALL_LOCATION)/include cp libhello_world.h $(INSTALL_LOCATION)/include clean: rm -f *.o hello-world-c libhello_world.so