File: Makefile

package info (click to toggle)
sipp 3.1-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,268 kB
  • ctags: 744
  • sloc: ansic: 8,534; makefile: 304; lex: 65; sh: 14
file content (134 lines) | stat: -rw-r--r-- 3,662 bytes parent folder | download | duplicates (3)
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
#
# SIPP - a 3-d rendering library
#
# Copyright  Equivalent Software HB
#
# This is the main Makefile for sipp version 3.1. This directory
# contains three subdirectories:
# libsipp: source code for the library itself.
# demo:    source code for demonstrations and tests
# doc:     standard manual pages for the library.
#
# You can either make the library and the tests/demos separately or 
# you can make them all in one make session. 
#
# To create the library, just type 'make library'.
# To make the demo programs, type 'make demos', but if you haven't 
# made the library first, this will be made automatically for you by
# the makefile in the demos directory.
#
# Before you can make anything, though, you may have to edit the 
# following definitions:


# If your C compiler doesn't grok the void type, uncomment the 
# following line:
#NOVOID = -Dvoid=int


# If you don't have memcpy() and friends in your C library, or 
# if you don't have memory.h in /usr/include, uncomment the
# following line:
#NOMEMCPY = -DNOMEMCPY


# If you don't have alloca(), uncomment the following line:
#ALLOCA = -DHAVE_NO_ALLOCA

# If you have alloca (often in libPW), but don't have alloca.h, uncomment
# the following line:
#ALLOCA = -DHAVE_NO_ALLOCA_H

#
# If you need extra libraries during the link, define them here.
#LIBS=

# LIBDIR is where libsipp.a will be placed when you make install.
# INCLUDEDIR is where the include files will be placed when you make install.
# MANDIR is where the manuals will be placed when you make install.
# MANEXT is the extension the manuals will receive in MANDIR

LIBDIR = /usr/local/lib
INCLUDEDIR = /usr/local/include
MANDIR = /usr/local/man/man3
MANEXT = 3


# The variable EXTRA_FLAGS should be used for any configuration
# flags that you want to use during the compilation.
#
# If you want to make SIPP as a shared library under SunOS you
# need to define the following two targets:
#LIBSH = libsipp.so
#LIBHINST = install.shared
# and the following extra flags if you use gcc:
#EXTRA_FLAGS = -fPIC
# or if you use Sun cc:
#EXTRA_FLAGS = -pic

EXTRA_FLAGS =

# Choose a suitable C compiler and appropriate flags:
CC = gcc -pipe
CFLAGS = -O3 $(EXTRA_FLAGS)


# Choose a lexical analyzer generator:
LEX = flex


SHELL = /bin/sh
RM = rm -f


# ================================================================
#           Don't change anything below this line.
# ================================================================

DOCFILES = primitives.man shaders.man sipp.man sipp_pixmap.man geometric.man


MAKEOPTS = CC="$(CC)" LEX="$(LEX)" \
	CFLAGS="$(NOVOID) $(NOMEMCPY) $(ALLOCA) $(CFLAGS) -I../libsipp" \
	LIBS="$(LIBS)"
ANIMMAKEOPTS = CC="$(CC)" \
	CFLAGS="$(NOVOID) $(NOMEMCPY) $(ALLOCA) $(CFLAGS) -I../../libsipp" \
	LIBS="$(LIBS)"
        

all: library demos

library:
	cd libsipp; $(MAKE) $(MAKEOPTS) libsipp.a $(LIBSH)

# be sure to clean objects and recompile with fPIC for shared
shared:
	cd libsipp; $(MAKE) $(MAKEOPTS)  shared 

demos:  library
	cd demo; $(MAKE) $(MAKEOPTS) programs
	cd demo/animation; $(MAKE) $(ANIMMAKEOPTS) all


install: library
	cd libsipp; $(MAKE) LIBDIR=$(LIBDIR) INCLUDEDIR=$(INCLUDEDIR) \
                install $(LIBHINST)
	for i in $(DOCFILES) ; do \
	    cp doc/$$i $(MANDIR)/`basename $$i .man`.$(MANEXT); \
	done



clean:
	$(RM) *~ *shar*
	cd libsipp; $(MAKE) clean;
	cd demo; $(MAKE) clean;
	cd demo/animation; $(MAKE) clean;
	cd doc; ls -1 | egrep -v \
        \(\\.man$$\)\|\(\\.tex$$\)\|\(\\.texinfo$$\)\|\(\\.ps$$\) | xargs $(RM)


shar: clean
	shar -a -n sipp-3.0 -L 50 -o sipp-3.0.shar Makefile README CHANGES \
        COMPATIBILITY INSTALL \
	libsipp/* doc/* demo/*