123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #
- # package data
- #
- PACKAGE_NAME=avdl
- PACKAGE_VERSION=0.0.5
- #
- # compiler data
- #
- COMPILER_FLAGS=-Wall -Wpedantic -Wformat-security#-Werror
- COMPILER_DEFINES=\
- -DPKG_NAME=\"${PACKAGE_NAME}\"\
- -DPKG_VERSION=\"${PACKAGE_VERSION}\"
- COMPILER_INCLUDES=-Iinclude
- #
- # directories
- #
- DIRECTORY_BUILD=build
- DIRECTORY_EXE=${DIRECTORY_BUILD}/bin
- DIRECTORY_OBJ=${DIRECTORY_BUILD}/objects
- DIRECTORY_ALL=${DIRECTORY_BUILD} ${DIRECTORY_EXE} ${DIRECTORY_OBJ}
- #
- # source files
- #
- SRC=$(wildcard src/*.c)
- OBJ=${SRC:src/%.c=${DIRECTORY_OBJ}/%.o}
- HEADERS=$(widcard include/*.h)
- #
- # executable
- #
- EXECUTABLE=${DIRECTORY_EXE}/${PACKAGE_NAME}
- #
- # c engine data
- #
- CENGINE_PATH=engines/cengine
- #
- # system data
- #
- prefix=/usr/local
- #
- # compile the package, together with all engines
- #
- all: ${EXECUTABLE}
- ${MAKE} -C ${CENGINE_PATH} all
- #
- # build the executable, depends on source files
- #
- ${EXECUTABLE}: ${DIRECTORY_ALL} ${OBJ}
- $(CC) ${COMPILER_FLAGS} ${COMPILER_DEFINES} ${COMPILER_INCLUDES} ${OBJ} -o $@
- #
- # install the program to the current system
- #
- install: ${EXECUTABLE}
- @# executable
- mkdir -p ${DESTDIR}${prefix}/bin
- install ${EXECUTABLE} ${DESTDIR}${prefix}/bin/
- @# manual
- mkdir -p ${DESTDIR}${prefix}/share/man/man1/
- install manual/avdl.1 ${DESTDIR}${prefix}/share/man/man1/
- @# android engine
- mkdir -p ${DESTDIR}${prefix}/share/avdl/android
- cp -r engines/android/* ${DESTDIR}${prefix}/share/avdl/android
- @# c engine
- ${MAKE} -C ${CENGINE_PATH} prefix="${prefix}" destdir="${DESTDIR}" install
- #mkdir -p ${INSTALL_LOCATION}/share/info/
- #install avdl.info.gz ${INSTALL_LOCATION}/share/info/
- # vim files
- #mkdir -p ${INSTALL_LOCATION}/share/vim/vimfiles/syntax/
- #install vim/syntax/avdl.vim ${INSTALL_LOCATION}/share/vim/vimfiles/syntax/
- #mkdir -p ${INSTALL_LOCATION}/share/vim/vimfiles/ftdetect/
- #install vim/ftdetect/avdl.vim ${INSTALL_LOCATION}/share/vim/vimfiles/ftdetect/
- #
- # create a tarball of all source files needed to compile this project
- #
- tarball: ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar
- ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar:
- tar cf $@ src makefile engines include
- #
- # clean all automatically generated files
- #
- clean:
- ${MAKE} -C ${CENGINE_PATH} clean
- rm -f ${EXECUTABLE} ${OBJ}
- #
- # create needed directories
- #
- ${DIRECTORIES} ${DIRECTORY_ALL}:
- mkdir -p $@
- #
- # compile .c source files
- #
- ${DIRECTORY_OBJ}/%.o: src/%.c ${HEADERS}
- $(CC) ${COMPILER_FLAGS} ${COMPILER_DEFINES} ${COMPILER_INCLUDES} -c $< -o $@
- .PHONY: all tarball clean install
|