diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -1,7 +1,9 @@ -.PHONY: server client shared install +.PHONY: server client shared clean install uninstall cleanall # > configuration start +inst_dir = /usr/local/ + lib_name := som_net CC = gcc @@ -17,11 +19,16 @@ SHARED_LD = -shared -fPIC CLIENT_LD = -l${lib_name} SERVER_LD = -l${lib_name} -export LD_LIBRARY_PATH:=`pwd` +export LD_LIBRARY_PATH=`pwd` # help text default: - @echo " make targets: shared, client, server, [install >WIP<]" - @echo " *shared is required for all targets!" + @echo "targets:" + @echo " build: *shared is required for all targets" + @echo " > shared, client, server" + @echo " delete:" + @echo " > clean, uninstall, cleanall" + @echo " install:" + @echo " > install" # target: client client: .client_comp @@ -41,5 +48,16 @@ shared: .shared_comp clean: rm -f $(wildcard ./**/*.o) client_example server_example lib${lib_name}.so +install: + cp "lib${lib_name}.so" "${inst_dir}lib/" + mkdir -p "${inst_dir}include/${lib_name}/" + cp shared/*.h "${inst_dir}include/${lib_name}/" + +uninstall: + rm "${inst_dir}lib/lib${lib_name}.so" + rm -r "${inst_dir}include/${lib_name}" + +cleanall: clean uninstall + **/%.o: **/%.c $(CC) -c -o $@ $< |