First commit - second part

Former-commit-id: 202296404e6a70f8ae96db99faffb456104c57e9
Former-commit-id: 118417735d2055683607df9809c9b721cc1b1bab
This commit is contained in:
2015-10-02 21:12:35 +02:00
parent f44f0d8179
commit d298385685
316 changed files with 122579 additions and 0 deletions

BIN
config/.DS_Store vendored Normal file

Binary file not shown.

51
config/README.txt Executable file
View File

@ -0,0 +1,51 @@
$Id: README.txt 1825 2013-02-26 09:39:47Z viari $
This directory contains Makefile machine specific configuration files
(and default targets to help you writing Makefile's)
These headers should be used with GNU make or compatible
#
# portname
#
To check your port, issue :
./guess_port
if output is 'unknown <mach>:<sys>:<rel>' then you should :
- add a port entry in guess_port for <mach>:<sys>:<rel>
- create a ports/<port>.conf configuration file
(the best is to start from another port file,
choose whatever looks closest)
#
# configuration flags
#
auto.conf : the main configuration file :
- determine the machine port thru 'guess_port' shell
- include 'default.conf' file
- include the machine specific 'ports/<port>.conf' file
default.conf : default configuration (included by 'auto.conf')
ports/<port>.conf : machine specific configuration (included by 'auto.conf')
#
# utility targets
#
targets/help.targ : target for standard help
targets/propagate.targ : target for propagating targets to subdirectories
targets/package.targ : default targets for standard package with 'configure'
targets/empty.targ : default empty targets (defined as double colon rules)
targets/lxbin.targ : default make targets for standard lx binary (without libraries)
targets/debug.targ : target to print debug information (for dev.)

54
config/auto.conf Normal file
View File

@ -0,0 +1,54 @@
#
# $Id: auto.conf 1825 2013-02-26 09:39:47Z viari $
#
# auto.conf
# auto configuration file using guess_port
#
# this file is included in Makefile
#
#
# default shell for gnu-make
#
SHELL = /bin/sh
#
# CFGDIR : location of config files = this file directory location
#
# CFGPRT : port name (as returned by guess_port)
#
# because builtin 'lastword' is missing in gnu-make 3.80
lastword = $(word $(words $1), $1)
CFGDIR := $(dir $(call lastword, $(MAKEFILE_LIST)))
CFGPRT := $(shell $(CFGDIR)guess_port)
# check if port is correctly defined
ifneq (1, $(words $(CFGPRT)))
entry := $(call lastword, $(CFGPRT))
$(error port is undefined - add entry for "$(entry)" in configuration file -)
endif
#
# PORTNAME : port name to use : default is CFGPRT but may be futher modified
# by machine specific configuration
PORTNAME = $(CFGPRT)
#
# default configuration
# may be overriden by machine dependant definitions below
#
include $(CFGDIR)default.conf
#
# machine dependant definitions
#
include $(CFGDIR)ports/$(CFGPRT).conf

124
config/default.conf Normal file
View File

@ -0,0 +1,124 @@
#
# $Id: default.conf 2007 2013-12-03 14:21:39Z viari $
#
# default.conf
# default configuration flags
# maybe further redefined by machine specific configuration
#
# this file is included by auto.conf
#
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# MACHDEF : define machine and OS specific flags
#
MACHDEF =
#
# CC : (ansi C) compiler command to use
# you may add some machine specific flags (like -arch ...)
# in the <machine>.conf configuration file
#
CC = gcc
#
# default compiler optimizer flag
#
OPTIM = -O
#
# CC_LIBS : additionnal machine specific $(CC) libraries
# like '-lC' on some machines
#
CC_LIBS =
#
# MALLOC_LIBS : machine specific malloc librairies
# like '-lmalloc' on SGI
#
MALLOC_LIBS =
#
# MATH_LIBS : machine specific math librairies
# like '-lm' on Solaris
#
MATH_LIBS =
#
# LINT : looks like LINT command does not exist anymore
# here is a rough replacement
#
LINT = gcc -S -Wall -Wno-format-y2k -W -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Wreturn-type \
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow \
-Wcast-align -Wbad-function-cast -Wchar-subscripts \
-Winline -Wnested-externs -Wredundant-decls
# ------------------------------------
# General system commands
# ------------------------------------
#
# AR : AR archive command
# ARFLAGS : $(AR) archiving flags
# ARXFLAGS : $(AR) extraction flags
#
AR = ar
ARFLAGS = rcv
ARXFLAGS = xv
#
# RANLIB : ranlib command
#
RANLIB = ranlib
#
# DIFF : diff command
#
DIFF = diff
#
# TAR : tar command
#
TAR = tar
# ------------------------------------
# Default locations
# ------------------------------------
#
# PRTDIR : port dependent files location (libraries and binaries)
# BINDIR : port binaries
# LIBDIR : port libraries
#
PRTDIR = $(CFGDIR)../ports/$(PORTNAME)
BINDIR = $(PRTDIR)/bin
LIBDIR = $(PRTDIR)/lib
# ------------------------------------
# default gmake variable in implicit rules
# ------------------------------------
CFLAGS = $(OPTIM) $(MACHDEF) -I$(INCDIR)
LDFLAGS = -L$(LIBDIR) -L.
LDLIBS = $(LIBS) $(MALLOC_LIBS) $(MATH_LIBS) $(CC_LIBS)
LINTFLAGS = $(MACHDEF) -I$(INCDIR)

33
config/guess_port Executable file
View File

@ -0,0 +1,33 @@
#! /bin/sh
#
# $Id: guess_port 1825 2013-02-26 09:39:47Z viari $
#
# @file: guess_port
# @desc: attempt to guess the portname
# @usage: guess_port
#
# @history:
# @+ <Gloup> Nov. 2000 first draft adapted from GNU config.guess
# @+ <Gloup> Feb. 2010 moved to sh
#
mach=`uname -m`
syst=`uname -s`
rels=`uname -r`
case ${mach}:${syst}:${rels} in
alpha:OSF1:* ) echo alpha-osf1;;
sun4*:SunOS:5.* ) echo sparc-solaris;;
i86pc:SunOS:5.* ) echo i386-solaris;;
sun4*:SunOS:* ) echo sparc-sunos;;
Power*:Darwin:* ) echo ppc-darwin;;
i*86:Linux:* ) echo i386-linux;;
x*86*:Linux:* ) echo i386-linux;;
i*86:Darwin:* ) echo i386-darwin;;
IP*:IRIX*:* ) echo mips-irix;;
i*86:MINGW32*:* ) echo x86-mingw32;;
*) echo unknown ${mach}:${syst}:${rels}; exit 1;;
esac
exit 0

View File

@ -0,0 +1,26 @@
#
# $Id: i386-darwin.conf 1825 2013-02-26 09:39:47Z viari $
#
# i386-darwin.conf
# configuration file for MacOS-X/Intel-Based/Darwin 1.2 with gcc compiler
# this file is included in Makefile
#
# system (uname -srp) : Darwin 8.7.1 i386
# compiler (cc --version) : i686-apple-darwin8-gcc-4.0.1
#
# check tags
# @uname:uname -srp:Darwin 8.7.1 i386
# @cc:cc --version:i686-apple-darwin8-gcc-4.0.1
#
#
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# MACHDEF : define machine and OS specific flags
#
MACHDEF = -DLX_TARGET_MACINTEL -DLITTLE_ENDIAN -DMACOSX

32
config/ports/i386-linux.conf Executable file
View File

@ -0,0 +1,32 @@
#
# $Id: i386-linux.conf 1825 2013-02-26 09:39:47Z viari $
#
# i386-linux.conf
# configuration file for linux ix86 with GNU gcc compiler
# this file is included in Makefile
#
# system (uname -srp) : Linux 2.2.14-5.0 unknown
# compiler (gcc --version) : egcs-2.91.66
#
# check tags
# @uname:uname -srp:Linux 2.2.14-5.0 unknown
# @cc:cc --version:egcs-2.91.66
#
#
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# MACHDEF : define machine and OS specific flags
#
MACHDEF = -DLX_TARGET_LINUX -DLITTLE_ENDIAN
#
# MATH_LIBS : machine specific math librairies
#
MATH_LIBS = -lm

32
config/ports/ppc-darwin.conf Executable file
View File

@ -0,0 +1,32 @@
#
# $Id: ppc-darwin.conf 1825 2013-02-26 09:39:47Z viari $
#
# ppc-darwin.conf
# configuration file for MacOS-X/Darwin 1.2 with native cc compiler
# this file is included in Makefile
#
# system (uname -srp) : Darwin 1.2 powerpc
# compiler (cc --version) : 2.7.2.1
#
# check tags
# @uname:uname -srp:Darwin 1.2 powerpc
# @cc:cc --version:2.7.2.1
#
#
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# MACHDEF : define machine and OS specific flags
#
MACHDEF = -DLX_TARGET_MACPPC -DBIG_ENDIAN
#
# CC : name of (ansi C) compiler to use
#
CC = cc -arch ppc

31
config/ports/sparc-solaris.conf Executable file
View File

@ -0,0 +1,31 @@
#
# $Id: sparc-solaris.conf 1825 2013-02-26 09:39:47Z viari $
#
# sparc-solaris.conf
# configuration file for sparc solaris with GNU gcc compiler
# this file is included in Makefile
#
# system (uname -srp) : SunOS 5.8 sparc
# compiler (gcc --version) : 2.95.2
#
# check tags
# @uname:uname -srp:SunOS 5.8 sparc
# @cc:cc --version:2.95.2
#
#
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# MACHDEF : define machine and OS specific flags
#
MACHDEF = -DLX_TARGET_SOLARIS -DBIG_ENDIAN
#
# MATH_LIBS : machine specific math librairies
#
MATH_LIBS = -lm

View File

@ -0,0 +1,54 @@
#
# $Id: x86-mingw32.conf 1825 2013-02-26 09:39:47Z viari $
#
# x86-mingw32
# configuration file for MinGW with GNU gcc compiler.
#
# this file is included in Makefile
#
#
#
# rename PORTNAME safely since MinGW produce pure win32 executables
# without dll's
#
PORTNAME = x86-win32
# ------------------------------------
# General compilation flags
# ------------------------------------
#
# CC_LIBS : additionnal machine specific $(CC) libraries
#
# libiberty is needed for some system extensions (like mkstemps)
#
CC_LIBS = -liberty
#
# MACHDEF : define machine and OS specific flags
#
# -DDLMALLOC : use dlmalloc instead of malloc (which does not have mallinfo)
# -posix is a new replacement for several MinGW32 flags, including:
# -D__USE_MINGW_ANSI_STDIO : mingw gcc flag to recognize the C99 "%zu" format
#
MACHDEF = -posix -DLX_TARGET_WIN32 -DWIN_MINGW -DDLMALLOC -DLITTLE_ENDIAN
#
# MATH_LIBS : machine specific math librairies
#
MATH_LIBS = -lm
# ------------------------------------
# General system commands
# ------------------------------------
#
# DIFF : diff command / should ignore cr on windows
#
DIFF = diff --strip-trailing-cr

25
config/targets/debug.targ Normal file
View File

@ -0,0 +1,25 @@
#
# $Id: help.targ 1825 2013-02-26 09:39:47Z viari $
#
# debug.targ
#
# target to print debug information (dev. only)
#
# it defines the following targets:
#
# debug :
# print debug
#
# it requires auto.conf
#
.PHONY: debug
debug::
@echo "+ PORTNAME: $(PORTNAME)"
@echo "+ CFGPRT: $(CFGPRT)"
@echo "+ CFGDIR: $(CFGDIR)"
@echo "+ PRTDIR: $(PRTDIR)"
@echo "+ MACHDEF: $(MACHDEF)"

24
config/targets/empty.targ Normal file
View File

@ -0,0 +1,24 @@
#
# $Id: $
#
# epty.targ
#
# default empty targets (defined as double colon rules)
#
#
#
# Rules
#
.PHONY: all test clean portclean help
all::
test::
clean::
portclean:: clean
test::

23
config/targets/help.targ Normal file
View File

@ -0,0 +1,23 @@
#
# $Id: help.targ 1825 2013-02-26 09:39:47Z viari $
#
# help.targ
#
# default target to print help
#
# it defines the following targets:
#
# help :
# print help
#
.PHONY: help
help::
@ echo "basic usage: make [<action>+]"
@ echo "valid <action> :"
@ echo " all : compile everything for current port [default target]"
@ echo " clean : local cleanup"
@ echo " portclean : cleanup distribution for current port"
@ echo " test : run tests on current port"
@ echo " help : print this help"

51
config/targets/lxbin.targ Normal file
View File

@ -0,0 +1,51 @@
#
# $Id: $
#
# lxbin.targ
#
# default make targets for standard lx binary
#
# you should define the 'PROGS' and 'OSRC' variables
# and optionnaly 'LIBS' if binaries have to be linked with libraries
#
# note: if main source code for binary PROG is PROG.c, there is nothing to do,
# else (e.g. if it involves several sources files) you should also add local
# file dependencies. e.g under the form:
#
# mymain: $(OBJ) mymain_base.c mymain_help.c
# $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
#
#
# 'auto.conf' should have been included
#
OBJ = $(OSRC:.c=.o)
INCDIR = ../include
#
# Rules
#
.PHONY: all prelib install test clean portclean
all:: prelib $(PROGS) install
@echo "+++++++++++ binaries $(PROGS) done"
prelib::
test -d $(PRTDIR) || mkdir $(PRTDIR) # because some linker may complain
test -d $(LIBDIR) || mkdir $(LIBDIR) # if -L$(LIBDIR) does not exist
install::
test -d $(PRTDIR) || mkdir $(PRTDIR)
test -d $(BINDIR) || mkdir $(BINDIR)
-for f in $(PROGS) ; do \cp -f $$f $(BINDIR) ; done
test::
clean::
-\rm -f *.o cvstatic* *% *.bak so_loc*
-\rm -f $(PROGS)
portclean:: clean
-(! test -d $(BINDIR)) || (cd $(BINDIR) && \rm -f $(PROGS))

43
config/targets/lxlib.targ Normal file
View File

@ -0,0 +1,43 @@
#
# $Id: $
#
# lxlib.targ
#
# default make targets for standard lx library
#
# you should define the 'LOCLIB' and 'OSRC' variables
#
# 'auto.conf' should have been included
#
OBJ = $(OSRC:.c=.o)
INCDIR = ../include
#
# Rules
#
.PHONY: all lib install test clean portclean
all:: lib install
@echo "+++++++++++ library $(LOCLIB) done"
lib:: $(OBJ)
$(AR) $(ARFLAGS) $(LOCLIB) $(OBJ)
$(RANLIB) $(LOCLIB)
install::
test -d $(PRTDIR) || mkdir $(PRTDIR)
test -d $(LIBDIR) || mkdir $(LIBDIR)
\cp -f $(LOCLIB) $(LIBDIR)
$(RANLIB) $(LIBDIR)/$(LOCLIB)
test::
clean::
-\rm -f *.o cvstatic* *% *.bak so_loc*
-\rm -f $(LOCLIB)
portclean:: clean
-(! test -d $(LIBDIR)) || (cd $(LIBDIR) && \rm -f $(LOCLIB))

View File

@ -0,0 +1,48 @@
#
# $Id: package.targ 1825 2013-02-26 09:39:47Z viari $
#
# package.targ
#
# default make targets for standard package with configure
#
# you should define the 'PKG' variable
# (and optionaly 'PKGTAR', 'PKGDIR')
#
PKGTAR ?= $(PKG).tgz
PKGDIR ?= build.$(PORTNAME)
PRTPATH = $(abspath $(PRTDIR))
#
# Rules
#
.PHONY: all clean test portclean pkg pkg.expand pkg.make pkg.install
all:: pkg
pkg.expand::
test -d $(PKGDIR) || mkdir $(PKGDIR)
test -f $(PKGDIR)/configure || $(TAR) zxf $(PKGTAR) -C $(PKGDIR) --strip-components 1
pkg.make:: pkg.expand
test -f $(PKGDIR)/Makefile || (cd $(PKGDIR) && ./configure --prefix=$(PRTPATH))
$(MAKE) -C $(PKGDIR)
pkg.install:: pkg.make
$(MAKE) -C $(PKGDIR) install
pkg:: pkg.install
@echo "+++++++++++ package $(PKG) done"
test::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) test
clean::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) clean
portclean::
(! test -d $(PKGDIR)) || $(MAKE) -C $(PKGDIR) distclean
(! test -d $(PKGDIR)) || \rm -r $(PKGDIR)

View File

@ -0,0 +1,30 @@
#
# $Id: propagate.targ 1825 2013-02-26 09:39:47Z viari $
#
# propagate.targ
#
# default make targets for library containers
#
# you should define the 'DIRS' variable
#
# It will propagate 'MAKE <target>' to all
# directories listed in DIRS
#
#
# Rules
#
.PHONY: all _action $(DIRS)
.DEFAULT:
$(MAKE) ACTION=$@ _action
all::
$(MAKE) ACTION=all _action
_action: $(DIRS)
@echo "$(ACTION) done"
$(DIRS):
$(MAKE) -C $@ $(ACTION)