mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
preparing libxil to be moved independent repository
This commit is contained in:
parent
c808af95b8
commit
67e109385d
4 changed files with 49 additions and 48 deletions
11
thirdparty/Makefile.inc
vendored
11
thirdparty/Makefile.inc
vendored
|
@ -1,12 +1,12 @@
|
|||
DEPS_CMAKE = libwebsockets criterion jansson
|
||||
DEPS_CMAKE = libxil libwebsockets criterion jansson
|
||||
DEPS_AUTOCONF = libnl libconfig libcurl
|
||||
|
||||
DEPS = libxil $(DEPS_CMAKE) $(DEPS_AUTOCONF)
|
||||
DEPS = $(DEPS_CMAKE) $(DEPS_AUTOCONF)
|
||||
|
||||
.PHONY: $(DEPS)
|
||||
|
||||
# Install all dependencies
|
||||
thirdparty: $(DEPS)
|
||||
thirdparty: libxil
|
||||
|
||||
# Install & compile autotools based projects
|
||||
$(DEPS_AUTOCONF): | $(BUILDDIR)/thirdparty/$$@/
|
||||
|
@ -20,11 +20,6 @@ $(DEPS_CMAKE): | $(BUILDDIR)/thirdparty/$$@/
|
|||
-B$(BUILDDIR)/thirdparty/$@
|
||||
make -C$(BUILDDIR)/thirdparty/$@ install
|
||||
|
||||
# Install & compile Xilinx standalone drivers
|
||||
libxil: | $(BUILDDIR)/thirdparty/$$@/
|
||||
make -C$(BUILDDIR)/thirdparty/$@ \
|
||||
-f$(SRCDIR)/thirdparty/$@/Makefile install
|
||||
|
||||
clean-thirdparty:
|
||||
for DEP in $(DEPS); do \
|
||||
pushd $$DEP; \
|
||||
|
|
36
thirdparty/libxil/CMakeLists.txt
vendored
Normal file
36
thirdparty/libxil/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
cmake_minimum_required (VERSION 3.2)
|
||||
|
||||
project(libxil C)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fPIC -I$(SRCDIR)/include/xilinx -Iorig/common_v1_00_a/src -Wno-int-conversion -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
|
||||
file(GLOB SOURCES src/*.c orig/*/src/*.c)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/xilinx)
|
||||
|
||||
add_library(xil SHARED ${SOURCES})
|
||||
|
||||
include(FindPkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
# convert lists of link libraries into -lstdc++ -lm etc..
|
||||
foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
|
||||
set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
|
||||
endforeach()
|
||||
|
||||
# Produce a pkg-config file for linking against the shared lib
|
||||
configure_file("libxil.pc.in" "libxil.pc" @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libxil.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
|
||||
endif()
|
||||
|
||||
install(TARGETS xil DESTINATION lib)
|
||||
|
||||
file(GLOB HEADERS include/xilinx/*.h)
|
||||
|
||||
# Make sure we dont install symlinks
|
||||
set (HEADERS_RESOLVED "")
|
||||
foreach (HEADER ${HEADERS})
|
||||
get_filename_component(HEADER_RESOLVED "${HEADER}" REALPATH)
|
||||
list (APPEND HEADERS_RESOLVED "${HEADER_RESOLVED}")
|
||||
endforeach()
|
||||
|
||||
install(FILES ${HEADERS_RESOLVED} DESTINATION include/xilinx)
|
40
thirdparty/libxil/Makefile
vendored
40
thirdparty/libxil/Makefile
vendored
|
@ -1,40 +0,0 @@
|
|||
LIB = libxil.so
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
SRCDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
VPATH = $(SRCDIR)
|
||||
|
||||
SRCS = $(wildcard $(SRCDIR)/src/*.c)
|
||||
SRCS += $(wildcard $(SRCDIR)/orig/*/src/*.c)
|
||||
OBJS = $(SRCS:$(SRCDIR)/%.c=%.o)
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -O3 -fPIC -I$(SRCDIR)/include/xilinx -Iorig/common_v1_00_a/src -Wno-int-conversion -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS += -DDEBUG -DXDEBUG_WARNING -g
|
||||
endif
|
||||
|
||||
all: $(LIB)
|
||||
|
||||
$(LIB): $(OBJS)
|
||||
$(CC) -shared -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(LIB) $(OBJS)
|
||||
|
||||
install: $(LIB)
|
||||
mkdir -p $(PREFIX)/include/xilinx
|
||||
install -m 0644 $(LIB) $(PREFIX)/lib
|
||||
install -m 0644 $(SRCDIR)/include/xilinx/*.h $(PREFIX)/include/xilinx
|
||||
@echo "note: you may need to run 'ldconfig'"
|
||||
@echo "note: make sure $(PREFIX)/lib is in your /etc/ld.so.conf or $$LD_LIBRARY_PATH"
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
||||
$(OBJS): | $$(dir $$@)
|
||||
|
||||
%/:
|
||||
mkdir -p $@
|
10
thirdparty/libxil/libxil.pc.in
vendored
Normal file
10
thirdparty/libxil/libxil.pc.in
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include
|
||||
libdir=${exec_prefix}/lib
|
||||
|
||||
Name: xil
|
||||
Description: Xilinx standalone drivers
|
||||
Version: 1.0.0
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lxil
|
Loading…
Add table
Reference in a new issue