From bfd4b9f5f39347f98fba32dd71a39627bce8ff95 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Mon, 19 Aug 2013 11:47:49 +0200 Subject: Rewrite faketime shell script in C --- src/Makefile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index b6442a6..35e6f2b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -52,33 +52,34 @@ INSTALL ?= install PREFIX ?= /usr/local -CFLAGS += -std=gnu99 -Wall -DFAKE_STAT -DFAKE_INTERNAL_CALLS -fPIC -DPOSIX_REALTIME -DLIMITEDFAKING -DSPAWNSUPPORT -LDFLAGS += -shared +CFLAGS += -std=gnu99 -Wall -DFAKE_STAT -DFAKE_INTERNAL_CALLS -fPIC -DPOSIX_REALTIME -DLIMITEDFAKING -DSPAWNSUPPORT -DPREFIX='"'$(PREFIX)'"' +LIB_LDFLAGS += -shared LDADD += -ldl -lm -lpthread -SRC = faketime.c -OBJ = faketime.o faketimeMT.o +SRC = libfaketime.c +LIBS_OBJ = libfaketime.o libfaketimeMT.o +BINS = faketime SONAME = 1 LIBS = libfaketime.so.${SONAME} libfaketimeMT.so.${SONAME} -all: ${LIBS} +all: ${LIBS} ${BINS} faketimeMT.o: EXTRA_FLAGS := -DPTHREAD -DPTHREAD_SINGLETHREADED_TIME -${OBJ}: faketime.c +${LIBS_OBJ}: libfaketime.c ${CC} -o $@ -c ${CFLAGS} ${EXTRA_FLAGS} $< -lib%.so.${SONAME}: %.o - ${CC} -o $@ -Wl,-soname,$@ ${LDFLAGS} $< ${LDADD} +%.so.${SONAME}: %.o + ${CC} -o $@ -Wl,-soname,$@ ${LIB_LDFLAGS} $< ${LDADD} clean: - @rm -f ${OBJ} ${LIBS} + @rm -f ${LIBS_OBJ} ${LIBS} ${BINS} distclean: clean @echo -install: ${LIBS} +install: ${LIBS} ${BINS} @echo @echo "Copying the faketime libraries to ${DESTDIR}${PREFIX}/lib/faketime and the faketime wrapper script to ${DESTDIR}${PREFIX}/bin ..." $(INSTALL) -dm0755 "${DESTDIR}${PREFIX}/lib/faketime/" -- cgit v1.2.1