-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 866 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Makefile for mqtt_servo_bridge
# Build HAL-MQTT bridge for IS620N
CC = gcc
CFLAGS = -Wall -O2 -g
LIBS = -lhal -lpaho-mqtt3c -lrt -lpthread
# Paho MQTT library paths (adjust if needed)
MQTT_INCLUDE = -I/usr/include
MQTT_LIB = -L/usr/lib
# HAL paths (for LinuxCNC)
HAL_INCLUDE = -I/usr/include/linuxcnc
HAL_LIB = -L/usr/lib
TARGET = mqtt_servo_bridge
all: $(TARGET)
$(TARGET): mqtt_servo_bridge.c
$(CC) $(CFLAGS) $(HAL_INCLUDE) $(MQTT_INCLUDE) \
mqtt_servo_bridge.c -o $(TARGET) \
$(HAL_LIB) $(MQTT_LIB) $(LIBS)
@echo ""
@echo "✓ Build complete: $(TARGET)"
@echo " Size: $$(du -h $(TARGET) | cut -f1)"
@echo ""
clean:
rm -f $(TARGET) *.o
install:
cp $(TARGET) /usr/local/bin/
@echo "✓ Installed to /usr/local/bin/$(TARGET)"
test: $(TARGET)
@echo "Testing $(TARGET)..."
./$(TARGET) --help || true
.PHONY: all clean install test