Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[glibutil] Initial commit
- Loading branch information
0 parents
commit bb8244c
Showing
16 changed files
with
1,310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*~ | ||
debian/files | ||
debian/libglibutil-dev.debhelper.log | ||
debian/libglibutil-dev.substvars | ||
debian/libglibutil-dev | ||
debian/libglibutil.debhelper.log | ||
debian/libglibutil.postinst.debhelper | ||
debian/libglibutil.postrm.debhelper | ||
debian/libglibutil.substvars | ||
debian/libglibutil | ||
debian/tmp | ||
documentation.list | ||
installroot | ||
build | ||
RPMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
# -*- Mode: makefile-gmake -*- | ||
|
||
.PHONY: clean all debug release | ||
|
||
# | ||
# Required packages | ||
# | ||
|
||
PKGS = glib-2.0 | ||
|
||
# | ||
# Default target | ||
# | ||
|
||
all: debug release pkgconfig | ||
|
||
# | ||
# Library version | ||
# | ||
|
||
VERSION_MAJOR = 1 | ||
VERSION_MINOR = 0 | ||
VERSION_RELEASE = 0 | ||
|
||
NAME = glibutil | ||
LIB_NAME = lib$(NAME) | ||
LIB_DEV_SYMLINK = $(LIB_NAME).so | ||
LIB_SYMLINK1 = $(LIB_DEV_SYMLINK).$(VERSION_MAJOR) | ||
LIB_SYMLINK2 = $(LIB_SYMLINK1).$(VERSION_MINOR) | ||
LIB_SONAME = $(LIB_SYMLINK1) | ||
LIB = $(LIB_SONAME).$(VERSION_MINOR).$(VERSION_RELEASE) | ||
|
||
# | ||
# Sources | ||
# | ||
|
||
SRC = gutil_log.c | ||
|
||
# | ||
# Directories | ||
# | ||
|
||
SRC_DIR = src | ||
INCLUDE_DIR = include | ||
BUILD_DIR = build | ||
DEBUG_BUILD_DIR = $(BUILD_DIR)/debug | ||
RELEASE_BUILD_DIR = $(BUILD_DIR)/release | ||
|
||
# | ||
# Tools and flags | ||
# | ||
|
||
CC = $(CROSS_COMPILE)gcc | ||
LD = $(CC) | ||
WARNINGS = -Wall | ||
INCLUDES = -I$(INCLUDE_DIR) | ||
BASE_FLAGS = -fPIC | ||
FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \ | ||
-MMD -MP $(shell pkg-config --cflags $(PKGS)) | ||
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) \ | ||
$(shell pkg-config --libs $(PKGS)) | ||
DEBUG_FLAGS = -g | ||
RELEASE_FLAGS = | ||
|
||
ifndef KEEP_SYMBOLS | ||
KEEP_SYMBOLS = 0 | ||
endif | ||
|
||
ifneq ($(KEEP_SYMBOLS),0) | ||
RELEASE_FLAGS += -g | ||
endif | ||
|
||
DEBUG_LDFLAGS = $(FULL_LDFLAGS) $(DEBUG_FLAGS) | ||
RELEASE_LDFLAGS = $(FULL_LDFLAGS) $(RELEASE_FLAGS) | ||
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG | ||
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2 | ||
|
||
# | ||
# Files | ||
# | ||
|
||
PKGCONFIG = $(BUILD_DIR)/$(LIB_NAME).pc | ||
DEBUG_OBJS = $(SRC:%.c=$(DEBUG_BUILD_DIR)/%.o) | ||
RELEASE_OBJS = $(SRC:%.c=$(RELEASE_BUILD_DIR)/%.o) | ||
|
||
# | ||
# Dependencies | ||
# | ||
|
||
DEPS = $(DEBUG_OBJS:%.o=%.d) $(RELEASE_OBJS:%.o=%.d) | ||
ifneq ($(MAKECMDGOALS),clean) | ||
ifneq ($(strip $(DEPS)),) | ||
-include $(DEPS) | ||
endif | ||
endif | ||
|
||
$(DEBUG_OBJS) $(DEBUG_LIB): | $(DEBUG_BUILD_DIR) | ||
$(RELEASE_OBJS) $(RELEASE_LIB): | $(RELEASE_BUILD_DIR) | ||
|
||
# | ||
# Rules | ||
# | ||
|
||
DEBUG_LIB = $(DEBUG_BUILD_DIR)/$(LIB) | ||
RELEASE_LIB = $(RELEASE_BUILD_DIR)/$(LIB) | ||
DEBUG_LINK = $(DEBUG_BUILD_DIR)/$(LIB_SYMLINK1) | ||
RELEASE_LINK = $(RELEASE_BUILD_DIR)/$(LIB_SYMLINK1) | ||
|
||
debug: $(DEBUG_LIB) $(DEBUG_LINK) | ||
|
||
release: $(RELEASE_LIB) $(RELEASE_LINK) | ||
|
||
pkgconfig: $(PKGCONFIG) | ||
|
||
clean: | ||
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~ | ||
rm -fr $(BUILD_DIR) RPMS installroot | ||
rm -fr debian/tmp debian/libglibutil debian/libglibutil-dev | ||
rm -f documentation.list debian/files debian/*.substvars | ||
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~ | ||
|
||
$(GEN_DIR): | ||
mkdir -p $@ | ||
|
||
$(DEBUG_BUILD_DIR): | ||
mkdir -p $@ | ||
|
||
$(RELEASE_BUILD_DIR): | ||
mkdir -p $@ | ||
|
||
$(DEBUG_BUILD_DIR)/%.o : $(SRC_DIR)/%.c | ||
$(CC) -c $(DEBUG_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@ | ||
|
||
$(RELEASE_BUILD_DIR)/%.o : $(SRC_DIR)/%.c | ||
$(CC) -c $(RELEASE_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@ | ||
|
||
$(DEBUG_LIB): $(DEBUG_OBJS) | ||
$(LD) $(DEBUG_OBJS) $(DEBUG_LDFLAGS) -o $@ | ||
|
||
$(RELEASE_LIB): $(RELEASE_OBJS) | ||
$(LD) $(RELEASE_OBJS) $(RELEASE_LDFLAGS) -o $@ | ||
ifeq ($(KEEP_SYMBOLS),0) | ||
strip $@ | ||
endif | ||
|
||
$(DEBUG_LINK): | ||
ln -sf $(LIB) $@ | ||
|
||
$(RELEASE_LINK): | ||
ln -sf $(LIB) $@ | ||
|
||
$(PKGCONFIG): $(LIB_NAME).pc.in | ||
sed -e 's/\[version\]/'$(VERSION_MAJOR).$(VERSION_MINOR)/g $< > $@ | ||
|
||
# | ||
# Install | ||
# | ||
|
||
INSTALL_PERM = 644 | ||
INSTALL_OWNER = $(shell id -u) | ||
INSTALL_GROUP = $(shell id -g) | ||
|
||
INSTALL = install | ||
INSTALL_DIRS = $(INSTALL) -d | ||
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM) | ||
|
||
INSTALL_LIB_DIR = $(DESTDIR)/usr/lib | ||
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME) | ||
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig | ||
|
||
INSTALL_ALIAS = $(INSTALL_LIB_DIR)/$(LIB_SHORTCUT) | ||
|
||
install: $(INSTALL_LIB_DIR) | ||
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR) | ||
ln -sf $(LIB) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2) | ||
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1) | ||
|
||
install-dev: install $(INSTALL_INCLUDE_DIR) $(INSTALL_PKGCONFIG_DIR) | ||
$(INSTALL_FILES) $(INCLUDE_DIR)/*.h $(INSTALL_INCLUDE_DIR) | ||
$(INSTALL_FILES) $(PKGCONFIG) $(INSTALL_PKGCONFIG_DIR) | ||
ln -sf $(LIB_SYMLINK1) $(INSTALL_LIB_DIR)/$(LIB_DEV_SYMLINK) | ||
|
||
$(INSTALL_LIB_DIR): | ||
$(INSTALL_DIRS) $@ | ||
|
||
$(INSTALL_INCLUDE_DIR): | ||
$(INSTALL_DIRS) $@ | ||
|
||
$(INSTALL_PKGCONFIG_DIR): | ||
$(INSTALL_DIRS) $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Library of glib utilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
libglibutil (1.0.0) unstable; urgency=low | ||
|
||
* Initial release | ||
|
||
-- Slava Monich <slava.monich@jolla.com> Sat, 27 Dec 2014 22:36:32 +0200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Source: libglibutil | ||
Section: libs | ||
Priority: optional | ||
Maintainer: Slava Monich <slava.monich@jolla.com> | ||
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0) | ||
Standards-Version: 3.8.4 | ||
|
||
Package: libglibutil | ||
Section: libs | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, ${misc:Depends} | ||
Description: Library of glib utilities | ||
|
||
Package: libglibutil-dev | ||
Section: libdevel | ||
Architecture: any | ||
Depends: libglibutil (= ${binary:Version}), ${misc:Depends} | ||
Description: Development files for libglibutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Copyright (C) 2014-2015 Jolla Ltd. | ||
Contact: Slava Monich <slava.monich@jolla.com> | ||
|
||
You may use this file under the terms of BSD license as follows: | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. Neither the name of the Jolla Ltd nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS | ||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ||
THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
debian/tmp/usr/lib/libglibutil.so usr/lib | ||
include/*.h usr/include/glibutil | ||
build/libglibutil.pc usr/lib/pkgconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
debian/tmp/usr/lib/libglibutil.so.* usr/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/make -f | ||
# -*- makefile -*- | ||
|
||
# Uncomment this to turn on verbose mode. | ||
#export DH_VERBOSE=1 | ||
|
||
override_dh_auto_install: | ||
dh_auto_install -- install-dev | ||
|
||
%: | ||
dh $@ |
Oops, something went wrong.