Commit 20229640 authored by Eric Coissac's avatar Eric Coissac

First commit - second part

parent a4ad0a5f
#
# ------------------------------------------
# ORG.Annot - Organelle Annotator
# version 1.0.0 - Sept 2015
# ------------------------------------------
#
# -------------------------
# -1- Installation
# -------------------------
#
# First check if binaries have been already compiled for your port
#
# $ scripts/check_port
#
# if it prints :
#
# + port <PORTNAME> is correctly installed
#
# then everything is fine
#
# if it prints :
#
# ! port <PORTNAME> not installed
# ! Please read README.txt for proper installation
#
# then, you should first compile binaries for your port
# please consult: src/README.txt for details
#
#
# -------------------------
# -2- Distribution organisation
# -------------------------
#
# config : config file for (re)compiling tools
# data : internal data files (e.g. ChloroDB)
# detectors : features specific detector scripts
# ports : binaries for various ports
# scripts : main scripts directory
# src : sources for (re)compiling tools
#
# -------------------------
# -3- Usage
# -------------------------
#
# note: all scripts are located in scripts, so you may add
# this directory in your path
# e.g. using csh
# set path = ($path <ROOTDIR>/scripts)
#
# @TODO : scripts description
#
$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.)
#
# $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
#
# $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)
#! /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
#
# $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
#
# $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
#
# $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
#
# $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
#
# $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
#
# $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)"
#
# $Id: $
#
# epty.targ
#
# default empty targets (defined as double colon rules)
#
#
#
# Rules
#
.PHONY: all test clean portclean help
all::
test::
clean::
portclean:: clean
test::
#
# $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"
#
# $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::