Skip to content
Snippets Groups Projects
Commit 10670766 authored by Anjan Chanda's avatar Anjan Chanda
Browse files

make: add install target

parent dd4fe5a3
No related branches found
No related tags found
No related merge requests found
Pipeline #53053 passed
...@@ -3,6 +3,13 @@ CFLAGS+=-I. -D_GNU_SOURCE ...@@ -3,6 +3,13 @@ CFLAGS+=-I. -D_GNU_SOURCE
CFLAGS+= -ggdb3 -Wall -Werror CFLAGS+= -ggdb3 -Wall -Werror
CFLAGS += -I/usr/include/libnl3 CFLAGS += -I/usr/include/libnl3
header-files=cmdu.h cmdu_ackq.h 1905_tlvs.h i1905_wsc.h bufutil.h \
timer_impl.h i1905_extension.h
lib-files=libmidgen.so libieee1905.so
bin-files=ieee1905d
OBJS = cmdu_input.o \ OBJS = cmdu_input.o \
cmdu_output.o \ cmdu_output.o \
config.o \ config.o \
...@@ -52,7 +59,7 @@ extmod_files = $(foreach d, $(extmod_subdirs), $(extmod_sofile)) ...@@ -52,7 +59,7 @@ extmod_files = $(foreach d, $(extmod_subdirs), $(extmod_sofile))
.PHONY: all clean tests docs .PHONY: all clean tests docs install
all: libmidgen.so libieee1905.so ieee1905d extmods tests all: libmidgen.so libieee1905.so ieee1905d extmods tests
...@@ -84,6 +91,10 @@ docs: ...@@ -84,6 +91,10 @@ docs:
cp docs/latex/refman.pdf docs/ieee1905.pdf cp docs/latex/refman.pdf docs/ieee1905.pdf
-include Makefile.inc
install: install-headers install-libs install-bins
for i in $(extmod_subdirs); do [ -d $$i ] && $(MAKE) -C $$i install; done
clean: clean:
rm -f *.o *.so $(EXECS) rm -f *.o *.so $(EXECS)
......
CP ?= cp -fpPR
INSTALL ?= install
INSTALL_DIR = $(INSTALL) -d -m 755
INSTALL_BIN = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_CONF = $(INSTALL) -m 600
INSTALL_LIB = $(CP)
ROOTDIR:=$(shell pwd)
INCDIR ?= /usr/include
LIBDIR ?= /usr/lib
BINDIR ?= /usr/sbin
IEEE1905_PLUGINS_DIR:=$(DESTDIR)/$(LIBDIR)/ieee1905
header-files ?= $(wildcard *.h)
library-files ?= $(wildcard *.so*)
bin-files ?=
$(DESTDIR)/$(INCDIR)/%: %
$(INSTALL_DATA) -D $< $@
$(DESTDIR)/$(LIBDIR)/%: %
$(INSTALL_DIR) $(DESTDIR)/$(LIBDIR)
$(INSTALL_LIB) $< $@
$(DESTDIR)/$(BINDIR)/%: %
$(INSTALL_DIR) $(DESTDIR)/$(BINDIR)
$(INSTALL_BIN) $< $@
export
install-headers: $(addprefix $(DESTDIR)/$(INCDIR)/,$(header-files))
install-libs: $(addprefix $(DESTDIR)/$(LIBDIR)/,$(library-files))
install-bins: $(addprefix $(DESTDIR)/$(BINDIR)/,$(bin-files))
...@@ -24,5 +24,13 @@ libmaputil.so: $(UTIL-OBJS) ...@@ -24,5 +24,13 @@ libmaputil.so: $(UTIL-OBJS)
$(MAP_PLUGIN): $(OBJS) $(MAP_PLUGIN): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^ -lmaputil $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^ -lmaputil
header-files = map2.h map_module.h
install:
$(INSTALL_DIR) $(IEEE1905_PLUGINS_DIR)
$(CP) $(MAP_PLUGIN) $(IEEE1905_PLUGINS_DIR)
$(CP) libmaputil.so $(DESTDIR)/$(LIBDIR)
$(INSTALL_DATA) $(header-files) $(DESTDIR)/$(INCDIR)
clean: clean:
rm -f *.o *.so* rm -f *.o *.so*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment