aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/chelper/GNUmakefile')
-rw-r--r--klippy/chelper/GNUmakefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/klippy/chelper/GNUmakefile b/klippy/chelper/GNUmakefile
new file mode 100644
index 00000000..acad5b62
--- /dev/null
+++ b/klippy/chelper/GNUmakefile
@@ -0,0 +1,24 @@
+filter_cc_option = $(shell $(CC) $(1) -E -x c /dev/null -o /dev/null >/dev/null 2>&1 && printf %s $(1))
+
+objs := itersolve.o kin_cartesian.o kin_corexy.o kin_corexz.o kin_delta.o \
+ kin_deltesian.o kin_extruder.o kin_generic.o kin_idex.o kin_polar.o \
+ kin_rotary_delta.o kin_shaper.o kin_winch.o msgblock.o pollreactor.o \
+ pyhelper.o serialqueue.o stepcompress.o trapq.o trdispatch.o
+
+hub_ctrl := hub-ctrl
+hub_ctrl_objs := hub-ctrl.o
+
+sse_flags = $(call filter_cc_option -mfpmath=sse) $(call filter_cc_option -fno-use-linker-plugin)
+CFLAGS ?= -Wall -O2 -flto -fno-fat-lto-objects $(sse_flags)
+CFLAGS += -std=gnu17 -MMD -MP
+LDFLAGS ?= -flto
+
+
+c_helper.so: CFLAGS += -fPIC
+c_helper.so: LDFLAGS += -shared -fPIC
+c_helper.so: $(objs)
+ $(LINK.o) $^ $(LDLIBS) -o $@
+
+$(objs): GNUmakefile
+
+-include: $(objs:.o=.d)