summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 13:30:22 -0500
committerWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 13:30:22 -0500
commitd059c61022230a89467e3aaf6475a53d5f2bbdf5 (patch)
tree62272e00d6945df9fcad73602970591c425fa198
parent0b17ab1b84e43d1349334d34f6587539e2b10981 (diff)
downloadgcompat-d059c61022230a89467e3aaf6475a53d5f2bbdf5.tar.gz
gcompat-d059c61022230a89467e3aaf6475a53d5f2bbdf5.tar.bz2
gcompat-d059c61022230a89467e3aaf6475a53d5f2bbdf5.tar.xz
gcompat-d059c61022230a89467e3aaf6475a53d5f2bbdf5.zip
add Makefile
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5574d68
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+LIBGCOMPAT_SRC = \
+ libgcompat/backtrace.c \
+ libgcompat/dlmopen.c \
+ libgcompat/dlvsym.c \
+ libgcompat/gnulib.c \
+ libgcompat/malloc.c \
+ libgcompat/math.c \
+ libgcompat/pthread.c \
+ libgcompat/resource.c \
+ libgcompat/setjmp.c \
+ libgcompat/stdio.c \
+ libgcompat/stdlib.c \
+ libgcompat/string.c \
+ libgcompat/version.c
+LIBGCOMPAT_OBJ = ${LIBGCOMPAT_SRC:.c=.o}
+LIBGCOMPAT_SOVERSION = 0
+LIBGCOMPAT_NAME = libgcompat.so.${LIBGCOMPAT_SOVERSION}
+LIBGCOMPAT_PATH = /lib/${LIBGCOMPAT_NAME}
+
+LOADER_SRC = \
+ loader/loader.c
+LOADER_OBJ = ${LOADER_SRC:.c=.o}
+LOADER_NAME = ld-linux.so.2
+LOADER_PATH = /lib/${LOADER_NAME}
+
+all: ${LIBGCOMPAT_NAME} ${LOADER_NAME}
+
+${LIBGCOMPAT_NAME}: ${LIBGCOMPAT_OBJ}
+ gcc -o ${LIBGCOMPAT_NAME} -Wl,-soname,${LIBGCOMPAT_NAME} -shared ${LIBGCOMPAT_OBJ}
+
+${LIBGCOMPAT_NAME}: ${LIBGCOMPAT_OBJ}
+ gcc -o ${LIBGCOMPAT_NAME} -Wl,-soname,${LIBGCOMPAT_NAME} -shared ${LIBGCOMPAT_OBJ}
+
+.c.o:
+ gcc -fPIC -DPIC -DLINKER=\"${LINKER_PATH}\" -DLIBGCOMPAT=\"${LIBGCOMPAT_PATH}\" ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+
+clean:
+ rm -f libgcompat/*.o loader/*.o ${LIBGCOMPAT_NAME} ${LOADER_NAME}