libslip-c

C SLIP-encoding library
git clone https://git.sinitax.com/sinitax/libslip-c
Log | Files | Refs | LICENSE | sfeed.txt

Makefile (799B)


      1PREFIX ?= /usr/local
      2BINDIR ?= /bin
      3
      4CFLAGS = -I include
      5
      6ifeq "$(LIBSLIP_DEBUG)" "1"
      7CFLAGS += -g
      8endif
      9
     10all: build/libslip.so build/libslip.a
     11
     12clean:
     13	rm -rf build
     14
     15build:
     16	mkdir build
     17
     18build/libslip.a: src/slip.c include/slip.h | build
     19	$(CC) -o build/tmp.o src/slip.c $(CFLAGS) -r
     20	objcopy --keep-global-symbols=libslip.api build/tmp.o build/fixed.o
     21	ar rcs $@ build/fixed.o
     22
     23build/libslip.so: src/slip.c include/slip.h | build
     24	$(CC) -o $@ src/slip.c -fPIC $(CFLAGS) -shared -Wl,-version-script libslip.lds
     25
     26install:
     27	install -m755 build/libslip.so -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
     28	install -m755 build/libslip.a -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
     29
     30uninstall:
     31	rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)/libslip.so"
     32	rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)/libslip.a"
     33
     34.PHONY: all clean install uninstall