File: Make_kernel

package info (click to toggle)
libtsp 3r0-1
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 5,096 kB
  • ctags: 1,798
  • sloc: ansic: 14,464; sh: 1,217; makefile: 182
file content (135 lines) | stat: -rw-r--r-- 2,311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
#  Generic make commands (common part of other Make files)
#  For GNU make; will not work with most other make programs
#
#  Variables:
#    bindir		$(tspdir)/bin/
#    includedir		$(tspdir)/include
#    LIB		$(tspdir)/lib/libtsp.a
#    CFLAGS		-O2
#    FFLAGS		-u -O
#    LDFLAGS		-s
#    LINTFLAGS		-u -x
#    LNSFLAGS		-f
#    COMPILER		cc
#    LOADLIBES		$(LIB) -lm
#    BINDIR		bin

# $Id: Make_kernel 1.6 1998/04/15 libtsp-v3r0 $

# Get the OS name
UNAME := $(shell uname -s)
OS = unix

ifeq ($(UNAME),SunOS)
  rev := $(shell uname -r | cut -c1)
  ifeq ($(rev),4)
    OS = SunOS4
  else
    ifeq ($(rev),5)
      OS = SunOS5
    endif
  endif
endif

ifeq ($(UNAME),CYGWIN32_NT)
  OS = CYGWIN32_NT
endif

ifeq ($(UNAME),ULTRIX)
  OS = Ultrix
endif

SHELL = /bin/sh

# Setup for specific operating systems
# Generic unix setup
ifeq ($(OS),unix)
  BINDIR = bin
  LIBDIR = lib
  exec_prefix = /usr/local
endif

# SunOS 4
ifeq ($(OS),SunOS4)
  BINDIR = bin/sun4
  LIBDIR = lib/sun4
  exec_prefix = /usr/local
  CC = cc
  CFLAGS = -O2
endif

# Sun Solaris
ifeq ($(OS),SunOS5)
  BINDIR = bin
  LIBDIR = lib
  exec_prefix = /opt/local
  CC = cc
  CFLAGS = -xO4 -Xc -v
endif

# DEC Ultrix
ifeq ($(OS),Ultrix)
  BINDIR = bin
  LIBDIR = lib
  exec_prefix = /usr/local
  CC = cc
  CFLAGS = -O2
endif

# Gnu software under Windows NT
ifeq ($(OS),CYGWIN32_NT)
  BINDIR = bin
  LIBDIR = lib
  exec_prefix = //D/tsp
  CC = gcc
  CFLAGS = -O3 -Wall
endif

# Set exec_prefix
ifdef tspdir
  exec_prefix = $(tspdir)
endif

libdir = $(exec_prefix)/$(LIBDIR)
bindir = $(exec_prefix)/$(BINDIR)
includedir = $(exec_prefix)/include
htmldir = $(exec_prefix)/html
mandir = $(exec_prefix)/man

# Determine which language will be used
LANG = C
ifeq (.f,$(findstring .f,$(SOURCES)))
  LANG = FORTRAN
endif
ifeq (.F,$(findstring .F,$(SOURCES)))
  LANG = FORTRAN
endif

# Set the default library name
ifeq ($(LANG),FORTRAN)
  LIBNAME_DEFAULT = libuti
else
  LIBNAME_DEFAULT = libtsp
endif
ifndef LIBNAME
  LIBNAME = $(LIBNAME_DEFAULT)
endif
LIB = $(addsuffix .a,$(addprefix $(libdir)/,$(LIBNAME)))

# Options
FFLAGS = -u -O
LDFLAGS = -s
LINTFLAGS = -u -x

LNS = linksoft
LNSFLAGS = -f

# Choose which compiler to use
ifeq ($(LANG),FORTRAN)
  COMPILER = $(FC)
  LOADLIBES = $(LIB)
else
  COMPILER = $(CC)
  LOADLIBES = $(LIB) -lm
endif