Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:strainu
temelia
Makefile
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Makefile of Package temelia
## Temelia, C generic data structures library # to build for debugging level 3, invoke make CFLAGS=-g3 # compiler, archiver, linker CC = $(CROSS_COMPILE)gcc AR = $(CROSS_COMPILE)ar LD = $(CROSS_COMPILE)ld # configure dynamic linker LDCONF = ldconfig # compiler flags. Optimization level etc. CFLAGS += -g -O3 -fpic -Wall # project name PRJNAME = temelia # library name LIBNAME = lib$(PRJNAME).so.1 # project's (svn) version SVN_VERSION = $(shell svn info | cut -f2 -d" " | head -5 | tail -1) # library real name LIBREALNAME := $(LIBNAME).$(SVN_VERSION) # repo directories SRCDIR = src HDRDIR = $(SRCDIR)/include DEBDIR = deb # local install directories: # local dir for headers LOCINCDIR = /usr/local/include/$(PRJNAME) # local dir for library LOCLIBDIR = /usr/local/lib/$(PRJNAME) # deb package name DEBPKG = $(PRJNAME).deb # deb filesystem DEBFS = $(DEBDIR)/filesystem # deb files: CTRLBKP = $(DEBDIR)/control.sav DEBIAN = $(DEBFS)/DEBIAN CTRL = $(DEBIAN)/control POSTINST = $(DEBIAN)/postinst PRERM = $(DEBIAN)/prerm # variables: # library install size SIZE = `du $(DEBFS)$(LOCINCDIR) | cut -f1` HDRS = $(HDRDIR)/*.h # list of object files. these should be C sources with their .c suffix changed to .o # HACK: build all the C files in the directory # should specify them by hand. OBJS = $(shell ls $(SRCDIR)/*.c|tr '\n' ' '|sed -n -e s/\\.c/.o/gp) # what to build: a shared library all: $(LIBREALNAME) # build the library, must have built the objects first $(LIBREALNAME): $(OBJS) $(CC) -shared -Wl,-soname,$(LIBNAME) -o $(LIBREALNAME) $(OBJS) -lc # given an object ($@) that has a corresponding C source ($<), build it .c.o: $(CC) $(CFLAGS) -c "$<" -o "$@" # copy the header files and archive (needs the archive) install: $(LIBREALNAME) -mkdir -p $(DESTDIR)$(LOCINCDIR) cp $(HDRS) $(DESTDIR)$(LOCINCDIR) -mkdir -p $(DESTDIR)$(LOCLIBDIR) cp $(LIBREALNAME) $(DESTDIR)$(LOCLIBDIR) $(LDCONF) -n $(LOCLIBDIR) # build deb package (needs the archive) deb: $(DEBDIR)/$(DEBPKG) $(DEBDIR)/$(DEBPKG): $(LIBREALNAME) -mkdir -p $(DEBFS)$(LOCINCDIR) cp $(HDRS) $(DEBFS)$(LOCINCDIR) -mkdir -p $(DEBFS)$(LOCLIBDIR) cp $(LIBREALNAME) $(DEBFS)$(LOCLIBDIR) -mkdir -p $(DEBIAN) echo "#!/bin/bash" >$(POSTINST) echo "$(LDCONF) -n $(LOCLIBDIR)" >>$(POSTINST) echo "#!/bin/bash" >$(PRERM) echo "rm $(LOCLIBDIR)/$(LIBREALNAME)" >>$(PRERM) chmod +x $(POSTINST) $(PRERM) cp $(CTRLBKP) $(CTRL) echo "Installed-Size: $(SIZE)" >>$(CTRL) echo "Version: 1.0.$(SVN_VERSION)" >>$(CTRL) dpkg -b $(DEBFS) $(DEBDIR)/$(DEBPKG) debclean: rm -rf $(DEBFS) rm -f $(DEBDIR)/$(DEBPKG) clean: rm -f $(OBJS) $(LIBREALNAME) uninstall: -rm -r $(DESTDIR)$(LOCINCDIR) -rm $(DESTDIR)$(LOCLIBDIR)/$(LIBREALNAME) .PHONY: clean debclean uninstall
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor