Obsolete
/
libipc-old
Archived
3
0
Fork 0

Improving Makefile.

more_to_read
Luka Vandervelden 2019-11-14 20:44:18 +01:00
parent ef2c05fc25
commit 534bd970a6
2 changed files with 18 additions and 24 deletions

View File

@ -7,11 +7,11 @@ LIBDIR := $(PREFIX)/lib
SHAREDIR := $(PREFIX)/share SHAREDIR := $(PREFIX)/share
INCLUDEDIR := $(PREFIX)/include INCLUDEDIR := $(PREFIX)/include
MANDIR := $(SHAREDIR)/man MANDIR := $(SHAREDIR)/man
CC := cc
AR := ar
RANLIB := ranlib
CFLAGS := -Wall -Wextra -g CFLAGS := -Wall -Wextra -g
CC := cc
CXX := c++
LD := ${CC}
CXXFLAGS :=
LDFLAGS := LDFLAGS :=
Q := @ Q := @
@ -40,7 +40,7 @@ src/ipc.h.uninstall:
$(Q)rm -f '$(DESTDIR)$(INCLUDEDIR)/ipc.h' $(Q)rm -f '$(DESTDIR)$(INCLUDEDIR)/ipc.h'
man/libipc.7: man/libipc.7.scd man man/libipc.7: man/libipc.7.scd man
@echo ' MAN > man/libipc.7' @echo ' MAN > man/libipc.7'
$(Q)scdoc < 'man/libipc.7.scd' > 'man/libipc.7' $(Q)scdoc < 'man/libipc.7.scd' > 'man/libipc.7'
@ -65,11 +65,11 @@ libipc.so.install: libipc.so
@echo ' IN > $(LIBDIR)/libipc.so.0.4.0' @echo ' IN > $(LIBDIR)/libipc.so.0.4.0'
$(Q)mkdir -p '$(DESTDIR)$(LIBDIR)' $(Q)mkdir -p '$(DESTDIR)$(LIBDIR)'
$(Q)install -m0755 libipc.so $(DESTDIR)$(LIBDIR)/libipc.so.0.4.0 $(Q)install -m0755 libipc.so $(DESTDIR)$(LIBDIR)/libipc.so.0.4.0
@echo ' LN > $(LIBDIR)/libipc.so.0.4' @echo ' LN > $(LIBDIR)/libipc.so.0.4'
$(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so.0.4' $(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so.0.4'
@echo ' LN > $(LIBDIR)/libipc.so.0' @echo ' LN > $(LIBDIR)/libipc.so.0'
$(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so.0' $(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so.0'
@echo ' LN > $(LIBDIR)/libipc.so' @echo ' LN > $(LIBDIR)/libipc.so'
$(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so' $(Q)ln -sf '$(LIBDIR)/libipc.so.0.4.0' '$(DESTDIR)/$(LIBDIR)/libipc.so'
libipc.so.clean: libipc.so.clean:
@ -209,25 +209,17 @@ $(DESTDIR)$(INCLUDEDIR):
$(DESTDIR)$(MANDIR): $(DESTDIR)$(MANDIR):
@echo ' DIR > $(MANDIR)' @echo ' DIR > $(MANDIR)'
$(Q)mkdir -p $(DESTDIR)$(MANDIR) $(Q)mkdir -p $(DESTDIR)$(MANDIR)
install: subdirs.install libipc.install src/ipc.h.install man/libipc.7.install libipc.so.install libipc.a.install src/communication.o.install src/error.o.install src/logger.o.install src/message.o.install src/network.o.install src/usocket.o.install src/utils.o.install src/communication.o.install src/error.o.install src/logger.o.install src/message.o.install src/network.o.install src/usocket.o.install src/utils.o.install install: libipc.install src/ipc.h.install man/libipc.7.install libipc.so.install libipc.a.install src/communication.o.install src/error.o.install src/logger.o.install src/message.o.install src/network.o.install src/usocket.o.install src/utils.o.install src/communication.o.install src/error.o.install src/logger.o.install src/message.o.install src/network.o.install src/usocket.o.install src/utils.o.install
@: @:
subdirs.install: uninstall: libipc.uninstall src/ipc.h.uninstall man/libipc.7.uninstall libipc.so.uninstall libipc.a.uninstall src/communication.o.uninstall src/error.o.uninstall src/logger.o.uninstall src/message.o.uninstall src/network.o.uninstall src/usocket.o.uninstall src/utils.o.uninstall src/communication.o.uninstall src/error.o.uninstall src/logger.o.uninstall src/message.o.uninstall src/network.o.uninstall src/usocket.o.uninstall src/utils.o.uninstall
uninstall: subdirs.uninstall libipc.uninstall src/ipc.h.uninstall man/libipc.7.uninstall libipc.so.uninstall libipc.a.uninstall src/communication.o.uninstall src/error.o.uninstall src/logger.o.uninstall src/message.o.uninstall src/network.o.uninstall src/usocket.o.uninstall src/utils.o.uninstall src/communication.o.uninstall src/error.o.uninstall src/logger.o.uninstall src/message.o.uninstall src/network.o.uninstall src/usocket.o.uninstall src/utils.o.uninstall
@: @:
subdirs.uninstall: test: all
test: all subdirs subdirs.test
@: @:
subdirs.test:
clean: libipc.clean src/ipc.h.clean man/libipc.7.clean libipc.so.clean libipc.a.clean src/communication.o.clean src/error.o.clean src/logger.o.clean src/message.o.clean src/network.o.clean src/usocket.o.clean src/utils.o.clean src/communication.o.clean src/error.o.clean src/logger.o.clean src/message.o.clean src/network.o.clean src/usocket.o.clean src/utils.o.clean clean: libipc.clean src/ipc.h.clean man/libipc.7.clean libipc.so.clean libipc.a.clean src/communication.o.clean src/error.o.clean src/logger.o.clean src/message.o.clean src/network.o.clean src/usocket.o.clean src/utils.o.clean src/communication.o.clean src/error.o.clean src/logger.o.clean src/message.o.clean src/network.o.clean src/usocket.o.clean src/utils.o.clean
distclean: clean distclean: clean
dist: dist-gz dist-xz dist-bz2 dist: dist-gz dist-xz dist-bz2
$(Q)rm -- $(PACKAGE)-$(VERSION) $(Q)rm -- $(PACKAGE)-$(VERSION)
@ -307,10 +299,12 @@ help:
@echo ' - uninstall  Deinstalls the project.' @echo ' - uninstall  Deinstalls the project.'
@echo '' @echo ''
@echo 'CLI-modifiable variables:' @echo 'CLI-modifiable variables:'
@echo ' - CC  ${CC}'
@echo ' - CFLAGS  ${CFLAGS}' @echo ' - CFLAGS  ${CFLAGS}'
@echo ' - CC  ${CC}'
@echo ' - CXX  ${CXX}'
@echo ' - LD  ${LD}'
@echo ' - CXXFLAGS  ${CXXFLAGS}'
@echo ' - LDFLAGS  ${LDFLAGS}' @echo ' - LDFLAGS  ${LDFLAGS}'
@echo ' - DESTDIR  ${DESTDIR}'
@echo ' - PREFIX  ${PREFIX}' @echo ' - PREFIX  ${PREFIX}'
@echo ' - BINDIR  ${BINDIR}' @echo ' - BINDIR  ${BINDIR}'
@echo ' - LIBDIR  ${LIBDIR}' @echo ' - LIBDIR  ${LIBDIR}'
@ -329,5 +323,5 @@ help:
@echo '' @echo ''
@echo 'Rebuild the Makefile with:' @echo 'Rebuild the Makefile with:'
@echo ' zsh ./build.zsh -c' @echo ' zsh ./build.zsh -c'
.PHONY: all subdirs clean distclean dist install uninstall help .PHONY: all clean distclean dist install uninstall help

View File

@ -2,7 +2,7 @@
package=ipc package=ipc
version=0.4.0 version=0.4.0
CFLAGS="-Wall -Wextra -g" variables+=(CFLAGS "-Wall -Wextra -g")
targets=(libipc src/ipc.h man/libipc.7) targets=(libipc src/ipc.h man/libipc.7)