From a9434eb8e68a3dc7a5bee3ff07446aee4ba17e32 Mon Sep 17 00:00:00 2001 From: Thomas Touhey Date: Wed, 18 May 2016 19:55:20 +0200 Subject: [PATCH] Continued trying to package --- .gitignore | 2 +- Makefile | 22 +++++++++++++++++++++- debian/rules | 20 +++++++------------- debian/rules.cfg | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 debian/rules.cfg diff --git a/.gitignore b/.gitignore index 7473380..80f9b2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /obj /libmonochrome.a -/libmonochrome_*.deb +/*.deb diff --git a/Makefile b/Makefile index d95c86b..802924c 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,8 @@ include $(CURDIR)/Makefile.cfg # DEDUCED VARIABLES ALLOBJ = $(SRC:%=$(OBJDIR)/%.o) -ALLINC = $(INCPUB:%=$(INCDIR)/%.h) $(INCINT:%=$(INCDIR)/%.h) +ALLINCPUB = $(INCPUB:%=$(INCDIR)/%.h) +ALLINC = $(ALLINCPUB) $(INCINT:%=$(INCDIR)/%.h) # STYLE VARS define \n @@ -48,7 +49,26 @@ fclean: clean ## Remake the project re: fclean all +## Give vars (for packaging) +getname: + @echo $(NAME) +getversion: + @echo $(VERSION) +getlibdir: + @echo . +getlib: + @echo lib$(NAME).a +getmandir: + @echo $(MANDIR) +getman: + @echo $(addprefix man3/,$(MAN3)) +getincdir: + @echo $(INCDIR) +getinc: + @echo $(INCPUB:%=%.h) + ## Doz rulz are phunny .PHONY: all clean fclean re +.PHONY: getname getversion getlibdir getlib getmandir getman getincdir getinc # END OF FILE diff --git a/debian/rules b/debian/rules index 0202369..9c36186 100755 --- a/debian/rules +++ b/debian/rules @@ -11,9 +11,7 @@ # Who said you had to use automatic tools to make Debian packages ? # #******************************************************************************# # LOAD CONFIG -include $(CURDIR)/../Makefile.cfg -PKG = cfx-lib$(NAME)-dev -ARCH = all +include $(CURDIR)/rules.cfg # STYLE VARS define \n @@ -35,16 +33,12 @@ build-indep: ## Install files into a file tree for each binary package under the debian dir. ## If defined, binary* targets effectively depend on this target. install: - mkdir -p $(ARCH) - $(INST) -m 755 -d $(ARCH)/usr/sh3eb-elf/lib/$(NAME)/$(VERSION)/include - $(INST) -m 644 ../lib$(NAME).a $(ARCH)/usr/sh3eb-elf/lib/$(NAME)/$(VERSION) - $(foreach inc, $(INCPUB), \ - $(if $(shell dirname $(inc).h), \ - $(INST) -m 755 -d $(ARCH)/usr/sh3eb-elf/lib/$(NAME)/$(VERSION)/include/$(shell dirname $(inc).h)$(\n)) \ - $(INST) -m 644 ../$(INCDIR)/$(inc).h $(ARCH)/usr/sh3eb-elf/lib/$(NAME)/$(VERSION)/include/$(shell dirname $(inc).h)$(\n)) - $(INST) -m 755 -d $(ARCH)/usr/share/man/man3 - $(foreach man, $(MAN3), \ - $(INST) -m 644 ../$(MANDIR)/man3/$(man) $(ARCH)/usr/share/man/man3$(\n)) + $(foreach lib, $(LIB), \ + $(INST) -m 644 ../$(LIBDIR)/$(lib) $(ARCH)$(LIBROOT)/$(lib)$(\n)) + $(foreach inc, $(INC), \ + $(INST) -m 644 ../$(INCDIR)/$(inc) $(ARCH)$(INCROOT)/$(inc)$(\n)) + $(foreach man, $(MAN), \ + $(INST) -m 644 ../$(MANDIR)/$(man) $(ARCH)$(MANROOT)/$(man)$(\n)) ## Create all binary packages binary: binary-arch binary-indep diff --git a/debian/rules.cfg b/debian/rules.cfg new file mode 100644 index 0000000..7e4e2c9 --- /dev/null +++ b/debian/rules.cfg @@ -0,0 +1,37 @@ +#!/usr/bin/make -f +#******************************************************************************# +# _____ _ # +# rules.cfg |_ _|__ _ _| |__ ___ _ _ # +# | Project : Caphics | |/ _ \| | | | '_ \ / _ \ | | | # +# | | (_) | |_| | | | | __/ |_| | # +# By: thomas |_|\___/ \__,_|_| |_|\___|\__, |.fr # +# Last updated: 2016/05/18 19:05:14 |___/ # +# # +#******************************************************************************# +# PROJECT INFORMATION +NAME = $(shell make -s -C .. getname) +VERSION = $(shell make -s -C .. getversion) + +# PACKAGE INFORMATION +PKG = cfx-lib$(NAME)-dev +ARCH = all + +# FILES +LIBDIR = $(shell make -C .. -s getlibdir) +LIB = $(shell make -s -C .. getlib) +INCDIR = $(shell make -C .. -s getincdir) +INC = $(shell make -s -C .. getinc) +MANDIR = $(shell make -C .. -s getmandir) +MAN = $(shell make -s -C .. getman) + +# BIN UTILITIES +MAKE = make -C +INST = install -D + +# TREE INFORMATION +GCCROOT = /usr/share/sh3eb-elf +LIBROOT = $(GCCROOT)/lib/$(NAME)/$(VERSION) +INCROOT = $(LIBROOT)/include +MANROOT = /usr/share/man + +# END OF FILE