Continued trying to package

This commit is contained in:
Thomas Touhey 2016-05-18 19:55:20 +02:00
parent 9c4d949819
commit a9434eb8e6
4 changed files with 66 additions and 15 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
/obj
/libmonochrome.a
/libmonochrome_*.deb
/*.deb

View File

@ -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

20
debian/rules vendored
View File

@ -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

37
debian/rules.cfg vendored Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/make -f
#******************************************************************************#
# _____ _ #
# rules.cfg |_ _|__ _ _| |__ ___ _ _ #
# | Project : Caphics | |/ _ \| | | | '_ \ / _ \ | | | #
# | | (_) | |_| | | | | __/ |_| | #
# By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.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