Compare commits

...

2 Commits

Author SHA1 Message Date
Xavier Del Campo Romero d0d843b704
Support installation 2023-10-02 14:39:43 +02:00
Xavier Del Campo Romero 0e779caae6
CMakeLists.txt: add cmake_minimum_required
This command is mandatory for all CMake projects. 3.0 was chosen since
dynstr does not require any newer CMake features.
2023-10-02 14:38:53 +02:00
2 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.0)
project(dynstr C)
add_library(${PROJECT_NAME} STATIC "dynstr.c")
target_include_directories(${PROJECT_NAME} PUBLIC "include")
install(TARGETS ${PROJECT_NAME})
install(DIRECTORY include/ TYPE INCLUDE)

View File

@ -14,6 +14,7 @@
.POSIX:
PREFIX = /usr/local
PROJECT = libdynstr.a
CFLAGS = -Iinclude
DEPS = \
@ -21,6 +22,14 @@ DEPS = \
all: $(PROJECT)
install: $(PROJECT)
mkdir -p $(PREFIX)/include
cp include/dynstr.h $(PREFIX)/include
chmod 0644 $(PREFIX)/include/dynstr.h
mkdir -p $(PREFIX)/bin
cp $(PROJECT) $(PREFIX)/bin
chmod 0755 $(PREFIX)/bin/$(PROJECT)
clean:
rm -f $(DEPS)