mirror of
https://git.planet-casio.com/Lephenixnoir/libprof.git
synced 2024-12-26 19:43:41 +01:00
switch build system to CMake
This commit is contained in:
parent
05e6463139
commit
02774004a2
4 changed files with 30 additions and 52 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,6 +1,5 @@
|
||||||
# Build files
|
# Build files
|
||||||
build/
|
build*/
|
||||||
libprof.a
|
|
||||||
|
|
||||||
# GiteaPC configuration files
|
# GiteaPC configuration files
|
||||||
giteapc-config-*.make
|
giteapc-config-*.make
|
||||||
|
|
17
CMakeLists.txt
Normal file
17
CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Build system for the libprof library for gint
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
project(libprof VERSION 2.2.1 LANGUAGES C)
|
||||||
|
|
||||||
|
find_package(Gint 2.2.1 REQUIRED)
|
||||||
|
|
||||||
|
add_compile_options(-Wall -Wextra -std=c11 -Os)
|
||||||
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
|
set(NAME "prof-${FXSDK_PLATFORM}")
|
||||||
|
add_library("${NAME}" STATIC libprof.c)
|
||||||
|
target_link_libraries("${NAME}" Gint::Gint)
|
||||||
|
|
||||||
|
install(TARGETS "${NAME}" DESTINATION "${FXSDK_COMPILER_INSTALL}")
|
||||||
|
install(FILES libprof.h DESTINATION "${FXSDK_COMPILER_INSTALL}/include")
|
||||||
|
|
46
Makefile
46
Makefile
|
@ -1,46 +0,0 @@
|
||||||
#! /usr/bin/make -f
|
|
||||||
# libprof Makefile
|
|
||||||
|
|
||||||
cflags := -m3 -mb -ffreestanding -nostdlib -fstrict-volatile-bitfields -Wall \
|
|
||||||
-Wextra -Os -I .
|
|
||||||
target ?= sh-elf
|
|
||||||
lib := libprof.a
|
|
||||||
header := libprof.h
|
|
||||||
|
|
||||||
PREFIX ?= $(shell $(target)-gcc -print-search-dirs | grep install \
|
|
||||||
| sed 's/install: //')
|
|
||||||
|
|
||||||
ifeq "$(PREFIX)" ""
|
|
||||||
$(error "Cannot determine compiler install path")
|
|
||||||
endif
|
|
||||||
|
|
||||||
src := $(wildcard *.c)
|
|
||||||
obj := $(src:%=build/%.o)
|
|
||||||
|
|
||||||
# Rules
|
|
||||||
|
|
||||||
all: $(lib)
|
|
||||||
|
|
||||||
$(lib): $(obj)
|
|
||||||
$(target)-ar rcs $@ $^
|
|
||||||
|
|
||||||
build/%.c.o: %.c | build/
|
|
||||||
$(target)-gcc -c $< -o $@ $(cflags)
|
|
||||||
|
|
||||||
# Misc rules
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@ rm -rf build
|
|
||||||
distclean: clean
|
|
||||||
@ rm -f $(lib)
|
|
||||||
|
|
||||||
%/:
|
|
||||||
mkdir -p $@
|
|
||||||
|
|
||||||
.PRECIOUS: %/
|
|
||||||
|
|
||||||
# Install
|
|
||||||
|
|
||||||
install: $(lib)
|
|
||||||
cp $(lib) $(DESTDIR)$(PREFIX)
|
|
||||||
cp $(header) $(DESTDIR)$(PREFIX)/include
|
|
16
giteapc.make
16
giteapc.make
|
@ -3,15 +3,23 @@
|
||||||
-include giteapc-config.make
|
-include giteapc-config.make
|
||||||
|
|
||||||
configure:
|
configure:
|
||||||
@ true
|
@ fxsdk build-fx -c
|
||||||
|
@ fxsdk build-cg -c
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ make
|
@ fxsdk build-fx
|
||||||
|
@ fxsdk build-cg
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@ make install
|
@ fxsdk build-fx install
|
||||||
|
@ fxsdk build-cg install
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@ make uninstall
|
@ if [[ -e build-fx/install_manifest.txt ]]; then \
|
||||||
|
xargs rm -f < build-fx/install_manifest.txt; \
|
||||||
|
fi
|
||||||
|
@ if [[ -e build-cg/install_manifest.txt ]]; then \
|
||||||
|
xargs rm -f < build-cg/install_manifest.txt; \
|
||||||
|
fi
|
||||||
|
|
||||||
.PHONY: configure build install uninstall
|
.PHONY: configure build install uninstall
|
||||||
|
|
Loading…
Reference in a new issue