aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-01-19 15:20:17 +0100
committerAnton Khirnov <anton@khirnov.net>2023-01-19 15:21:01 +0100
commitf50c6dcb90616636d79c5f18f16f9d45e71fb568 (patch)
tree845d2e550102d4f7e97f0acefa4e6a70874908e5
parent57a41e3a520fff66db8c5f42a7738a9d922e1305 (diff)
Switch from meson to plain make.HEADmaster
-rw-r--r--Makefile23
-rw-r--r--README4
-rw-r--r--meson.build16
3 files changed, 25 insertions, 18 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0eb3a7a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+TARGET = libthreadpool.so
+
+CFLAGS = -std=c99 -D_XOPEN_SOURCE=700 -fPIC -fopenmp -O3 -g -I.
+LDFLAGS = -Wl,--version-script=libthreadpool.v -shared -fopenmp
+CC = cc
+
+OBJS = \
+ threadpool.o
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CC) -o $@ $(OBJS) ${LDFLAGS}
+
+%.o: %.c
+ $(CC) $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
+
+clean:
+ -rm -f *.o *.d $(TARGET)
+
+-include $(OBJS:.o=.d)
+
+.PHONY: clean
diff --git a/README b/README
index 358cf7d..7b57e59 100644
--- a/README
+++ b/README
@@ -10,8 +10,8 @@ via email).
Building and installation
=========================
-The library uses the meson build system. A C11-compliant compiler and a POSIX
-environment are expected.
+A C11-compliant compiler and a POSIX environment are expected. Run 'make' to
+build the shared object.
Usage
=====
diff --git a/meson.build b/meson.build
deleted file mode 100644
index c2f6c76..0000000
--- a/meson.build
+++ /dev/null
@@ -1,16 +0,0 @@
-project('libthreadpool', 'c',
- default_options : ['c_std=c11'])
-
-add_project_arguments('-D_XOPEN_SOURCE=700', language : 'c')
-
-lib_src = [
- 'threadpool.c',
-]
-
-verscript = 'libthreadpool.v'
-ver_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), verscript)
-
-dep_omp = dependency('openmp')
-deps = [dep_omp]
-
-library('threadpool', lib_src, link_args : ver_flag, dependencies : deps)