diff options
author | jak1 <jak1@themanaworld.org> | 2023-01-11 13:10:56 +0100 |
---|---|---|
committer | jak1 <jak1@themanaworld.org> | 2023-01-11 13:10:56 +0100 |
commit | 0e13836fdf348e59a52835a0b2a2a41ba8292e06 (patch) | |
tree | 240ab7f711070b1b7015c5f54e6e393a97114108 /Makefile | |
parent | 99f8d7d20cf419edc0bf77d18252adcdcfbdb7e4 (diff) | |
download | simple_library_example-0e13836fdf348e59a52835a0b2a2a41ba8292e06.tar.gz simple_library_example-0e13836fdf348e59a52835a0b2a2a41ba8292e06.tar.bz2 simple_library_example-0e13836fdf348e59a52835a0b2a2a41ba8292e06.tar.xz simple_library_example-0e13836fdf348e59a52835a0b2a2a41ba8292e06.zip |
added make targets: install, uninstall, cleanallmaster
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 $@ $< |