PrimeModule-ext/Makefile

32 lines
872 B
Makefile
Raw Permalink Normal View History

2017-05-06 19:32:27 +02:00
NAME = primemodule
2021-10-24 18:22:14 +02:00
BINARY = ${NAME}
LIBRARY = lib${NAME}.so
2017-05-06 19:32:27 +02:00
COMPILER = g++
2021-10-24 18:22:14 +02:00
COMPILER_FLAGS = -Wall -std=c++11 -fpic -finline-functions -ffast-math -O3 -o
2017-05-06 19:32:27 +02:00
RM = rm -f
2021-10-24 18:22:14 +02:00
CP = cp
2017-08-27 10:22:03 +02:00
MKDIR = mkdir -p
2017-05-06 19:32:27 +02:00
2021-10-24 18:22:14 +02:00
DESTDIR ?= "/usr"
2017-05-06 19:32:27 +02:00
2021-10-24 18:22:14 +02:00
all: ${BINARY} ${LIBRARY}
2017-05-06 19:32:27 +02:00
2021-10-24 18:22:14 +02:00
${BINARY}: src/main.cpp src/${NAME}.hpp
${COMPILER} ${COMPILER_FLAGS} $@ src/main.cpp
2017-07-23 17:52:04 +02:00
2021-10-24 18:22:14 +02:00
${LIBRARY}: src/${NAME}.cpp src/${NAME}.hpp
${COMPILER} -shared ${COMPILER_FLAGS} $@ src/${NAME}.cpp
2017-07-23 17:52:04 +02:00
2021-10-24 18:22:14 +02:00
install: ${BINARY} ${LIBRARY} src/${NAME}.hpp src/${NAME}.h
2021-10-24 18:35:29 +02:00
${MKDIR} ${DESTDIR}/bin ${DESTDIR}/lib ${DESTDIR}/include
2021-10-24 18:22:14 +02:00
${CP} ${BINARY} ${DESTDIR}/bin
${CP} ${LIBRARY} ${DESTDIR}/lib
${CP} src/primemodule.hpp src/primemodule.h src/primemodule-ffi.h ${DESTDIR}/include
2017-05-06 19:32:27 +02:00
clean:
2021-10-24 18:22:14 +02:00
${RM} ${BINARY} ${LIBRARY}
2017-05-06 19:32:27 +02:00