Skip to content

Instantly share code, notes, and snippets.

@dpapathanasiou
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpapathanasiou/f64e29efc4a47aa9202a to your computer and use it in GitHub Desktop.
Save dpapathanasiou/f64e29efc4a47aa9202a to your computer and use it in GitHub Desktop.
Makefile for libmodbus
SHELL = /bin/sh
CC = gcc
FLAGS = -I /usr/local/include/modbus
LDIR = /usr/local/lib
LIBS = -lmodbus
%: %.c
$(CC) $(FLAGS) $^ -o $@ -L$(LDIR) $(LIBS)
TARGETS = $(shell echo *.c | sed -e 's/\.c//g')
all: $(TARGETS)
clean:
rm $(TARGETS)
@dpapathanasiou
Copy link
Author

This will work with libmodbus installed from source, using the default configuration target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment