network-analytics / udp-notif-c-collector

UDP-notif protocol c-collector
Other
4 stars 2 forks source link

Build system: install #46

Closed paololucente closed 3 years ago

paololucente commented 3 years ago

Dears,

I'd like to contribute a (rudimentary) idea for the make install target of the Makefile:

 ###### GCC options ######
+.PHONY: install
+
+INSTALL=install
+LDCONFIG=ldconfig
 ###### c-collector test files ######
 TDIR = test

+###### Install targets
+DESTDIR=/usr/local
+LIB_TARGET=libunyte.so
+PC_TARGET=unyte-pkg.pc
+INC_TARGET=$(DEPS)
+
 clean:
       rm $(ODIR)/*.o $(SAMPLES_ODIR)/*.o $(TDIR)/*.o $(BINS) libunyte.so
+
+install:
+       $(INSTALL) $(LIB_TARGET) $(DESTDIR)/lib
+       $(INSTALL) $(PC_TARGET) $(DESTDIR)/lib/pkgconfig
+       $(LDCONFIG)
+       $(INSTALL) -d $(DESTDIR)/include/unyte
+       $(INSTALL) $(INC_TARGET) $(DESTDIR)/include/unyte

One remark too: the pkg-config file currently is unyte-pkg.pc: we should make it match the library name, ie. libunyte.pc or, better, libunyte-udp-notif.pc.

Paolo

paololucente commented 3 years ago

I realized a tad late that there is a standalone install.sh script - sorry, sorry, sorry. This said, question: why? Why not having the install target in the Makefile? Where i mean even simply slam the install.sh script as part of an install target in the Makefile.

paololucente commented 3 years ago

Thanks for handling this.