File: Makefile.FreeBSD

package info (click to toggle)
manedit 0.8.1-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,488 kB
  • ctags: 2,910
  • sloc: ansic: 49,339; cpp: 3,562; sh: 690; makefile: 80
file content (145 lines) | stat: -rw-r--r-- 3,920 bytes parent folder | download | duplicates (4)
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
136
137
138
139
140
141
142
143
144
145
# ########################################################################
#
#                      Makefile for Manual Editor
#
#   Rules:
#
#	all	-- builds program.
#	install -- install program.
#	clean	-- remove object and other work files.
#
#       If no arguments are givin, the program is built by default.
#


# ########################################################################
# Installation Options:
#
#   You may modify any value as needed. Change only the ones you are
#   absolutly sure that requires modification.
#
PREFIX ?= /usr
LOCALBASE ?= /usr/local
X11BASE ?= /usr/X11R6


# ########################################################################
# Compiler Flags:
#
#   These are definations to enable or disable certain compile time
#   options. Omitting a defination turns that option off.
#
#   Each argument is of the format -D<option> where <option> is
#   one of the following:
#
#	USE_GETDENTS		Use getdents() instead of readdir().
#
#   Other arguments include:
#
#	-O#			Specifies the optimization level the
#				compiler is to compile at. This (attempts)
#				to improve the efficiency of the generated
#				program when it runs. Available values for
#				# are from 0 to 2 (some compilers allow
#				higher values). When in doubt, set # to 2.
#
#	-g			Compile with debugging information,
#				this is useful for determining why this
#				program (if it did) crash. However this
#				may hinder performance, so don't use
#				this option unless you are attempting
#				to debug the program.
#
GTK_CONFIG ?= gtk-config
GTK_CFLAGS = `$(GTK_CONFIG) --cflags`
CFLAGS += $(GTK_CFLAGS) -O2 -Wall \
          -DPREFIX=\"$(PREFIX)\" \
          -DLOCALBASE=\"$(LOCALBASE)\" -DX11BASE=\"$(X11BASE)\"

CPPFLAGS = -D__cplusplus -Dc_plusplus


# ########################################################################
# Dependant Libraries:
#
#   These are dynamic (sometimes called shared) libraries that this
#   program is to be `linked' to.
#
#   Each argument is of the format -l<name> where <name> is the name
#   of the library. You may have to add one or more -l<name> arguments
#   to the LIB line depending on what you have set in the CFLAGS line
#   farther above.
#
LIB = `$(GTK_CONFIG) --libs`

# Library Directories:
#
#   All libraries are looked for in the directories specified below.
#
#   Each argument is of the format -L<dir> where <dir> is the full
#   path to the directory.
#
LIB_DIR =

# Header File Directories:
#
#   Required header files that are not in the standard locations are
#   searched for in the directories specified below.
#
#   Each argument is of the format -I<dir> where <dir> is the full
#   path to the directory.
#
INC =


# ########################################################################
# Program Source and Header Files:
#
#   Do not modify any values in this section unless you know what you
#   are doing or have been instructed to do so.
#
include Makefile.srclist

BIN = manedit
CC  ?= gcc
CPP = $(CXX)
SED ?= sed
OBJ_C = $(SRC_C:.c=.o)
OBJ_CPP = $(SRC_CPP:.cpp=.o)
.c.o:
	$(CC) -c $*.c $(INC) $(CFLAGS)
.cpp.o:
	$(CPP) -c $*.cpp $(INC) $(CFLAGS) $(CPPFLAGS)


# ########################################################################
# Build Rules:
#
$(BIN): $(OBJ_C) $(OBJ_CPP)
	$(CC) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIB) $(LIB_DIR)

all: $(BIN) $(BIN).1.out


# ########################################################################
# Install Rules:
#
#   This rule is defined externally.
#
include Makefile.install.FreeBSD


# ########################################################################
# Maintainance and Misc Rules:
#
clean:
	rm -f a.out core *.o

# Manual Page Build/Subs Rule:
#
$(BIN).1.out: $(BIN).1
	$(SED) 's|%%PREFIX%%|$(PREFIX)|g ; \
		s|%%LOCALBASE%%|${LOCALBASE}|g ; \
		s|%%X11BASE%%|${X11BASE}|g' $(BIN).1 > $(BIN).1.out

# ########################################################################