crap/Makefile

62 lines
1.3 KiB
Makefile
Raw Normal View History

2013-05-22 15:56:59 -07:00
DISTNAME = crap
VERSION = git
EXE = design
2013-11-11 07:59:19 -08:00
SHOBJ = crap_eq.so crap_eq_const.so crap_noise.so
MID =
2013-11-10 13:51:05 -08:00
HEADERS = crap_util.h crap_util_def.h ladspa.h
2013-05-22 15:56:59 -07:00
OBJ = ${SHOBJ:.so=.o} ${EXE:=.o} ${MID}
SRC = ${OBJ:.o=.c}
2013-11-10 12:34:52 -08:00
WARNING_FLAGS = -Wall -Wno-unused-function
ALL_CFLAGS = -std=gnu99 -fpic ${WARNING_FLAGS} ${CFLAGS}
ALL_LDFLAGS = -lm ${LDFLAGS}
2013-05-22 15:56:59 -07:00
PREFIX ?= /usr/local
EXEC_PREFIX ?= ${PREFIX}
LIBDIR ?= ${EXEC_PREFIX}/lib
LADSPADIR ?= ${LIBDIR}/ladspa
FULLNAME = ${DISTNAME}-${VERSION}
ALL = ${OBJ} ${SHOBJ} ${EXE}
2013-05-22 15:56:59 -07:00
LADSPADEST = ${DESTDIR}${LADSPADIR}
all: options ${ALL}
.PHONY: options
options:
@echo "ALL_CFLAGS = ${ALL_CFLAGS}"
@echo "CPPFLAGS = ${CPPFLAGS}"
@echo "ALL_LDFLAGS = ${ALL_LDFLAGS}"
@echo "CC = ${CC}"
%.so: %.o ${MID}
@echo LD $< ${MID} -o $@
2013-11-10 12:34:52 -08:00
@${CC} ${ALL_CFLAGS} -shared $< ${MID} -o $@ ${ALL_LDFLAGS}
2013-05-22 15:56:59 -07:00
%: %.o ${MID}
2013-05-22 15:56:59 -07:00
@echo LD $< ${MID} -o $@
2013-11-10 12:34:52 -08:00
@${CC} ${ALL_CFLAGS} $< ${MID} -o $@ ${ALL_LDFLAGS}
2013-05-22 15:56:59 -07:00
%.o: %.c ${HEADERS}
@echo CC $< -o $@
@${CC} -c ${ALL_CFLAGS} ${CPPFLAGS} $< -o $@
install: all
mkdir -p ${LADSPADEST}
install -d ${LADSPADEST}
install -m 644 ${SHOBJ} ${LADSPADEST}
clean:
-rm -f ${ALL}
dist:
-rm -f ${FULLNAME}.tar.gz
mkdir -p ${FULLNAME}
cp LICENSE README.md Makefile ${HEADERS} ${SRC} ${FULLNAME}
tar -cf ${FULLNAME}.tar ${FULLNAME}
gzip ${FULLNAME}.tar
rm -rf ${FULLNAME}