Makefile (1046B)
- # SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier
- # SPDX-License-Identifier: MIT
- VERSION = 1.0.8
- CC ?= cc
- CFLAGS ?= -O2 -g -Wall -Wextra
- PREFIX ?= /usr
- BINDIR ?= ${PREFIX}/bin
- MANDIR ?= ${PREFIX}/share/man
- MAN1DIR ?= ${MANDIR}/man1
- PKG_CONFIG ?= pkg-config
- PNG_CFLAGS = `${PKG_CONFIG} --cflags libpng`
- PNG_LIBS = `${PKG_CONFIG} --libs libpng`
- all: xcursorgen
- Xcursor/file.o: Xcursor/file.c
- ${CC} -std=c99 ${CFLAGS} -c -o $@ Xcursor/file.c
- XCURSORGEN_SRC = xcursorgen.c Xcursor/file.o
- xcursorgen: ${XCURSORGEN_SRC} | *.h Xcursor/*.h
- ${CC} -std=c99 ${CFLAGS} ${PNG_CFLAGS} -o $@ ${XCURSORGEN_SRC} ${LDFLAGS} ${PNG_LIBS}
- .PHONY: install
- install: all
- mkdir -p ${DESTDIR}${BINDIR}
- cp -p xcursorgen ${DESTDIR}${BINDIR}/
- mkdir -p ${DESTDIR}${MAN1DIR}
- sed -e 's;xcursorgen-nox-git;xcursorgen-nox ${VERSION};' xcursorgen.1 > ${DESTDIR}${MAN1DIR}/xcursorgen.1
- SOURCES = *.c *.h Xcursor/*.h Xcursor/*.c
- .PHONY: format
- format:
- clang-format -i --style=file:.clang-format ${SOURCES}
- .PHONY: clean
- clean:
- rm xcursorgen Xcursor/file.o