summaryrefslogtreecommitdiff
path: root/PACE/pace/Makefile
blob: b871361105b2586aa64ae26688f3fe2f433bfb84 (plain)
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
#----------------------------------------------------------------------------
#       $Id$
#
#       Makefile for the PACE/pace C library release
#----------------------------------------------------------------------------

ifndef static_libs_only
  ifndef shared_libs_only
    static_libs_only = 1
  endif # ! shared_libs_only
endif # ! static_libs_only

# If we are inlining the PACE functions then we need to define
# PACE_HAS_INLINE. Inlining is the default.
ifndef inline
  CFLAGS += -DPACE_HAS_INLINE
endif # ! inline

ifeq (1,$(inline))
  CFLAGS += -DPACE_HAS_INLINE
endif # inline

MAKEFILE = Makefile
LIB      = libPACE.a
SHLIB    = libPACE.$(SOEXT)

PACE_FILES = \
  aio \
  assert \
  ctype \
  dirent \
  fcntl \
  grp \
  locale \
  math \
  mqueue \
  pthread \
  pwd \
  sched \
  semaphore \
  setjmp \
  signal \
  stdio \
  stdlib \
  string \
  termios \
  time \
  unistd \
  utime
CONFIG_FILES =
SYS_FILES = \
  sys/mman \
  sys/stat \
  sys/times \
  sys/utsname \
  sys/wait
# POSIX_SINGLE_PROCESS Unit of Functionality (POSIX.1)
# pace_sysconf is in unistd.h;
# pace_time is in time.h;
# pace_uname is in sys/ustname.h
POSIX_SP_FILES = \
  unistd \
  time \
  sys/utsname
# POSIX_MULTI_PROCESS Unit of Functionality (POSIX.1)
# pace__exit is in unistd.h
# pace_assert is in assert.h
# pace_execl, pace_execle, pace_execlp, pace_execv, pace_execve, pace_execvp
#  are in unistd.h;
# pace_exit is in stdlib.h;
# pace_fork is in unistd.h;
# pace_getenv is in stdlib.h;
# pace_getpid, pace_getppid are in unistd.h;
# pace_setlocale is in locale.h;
# pace_sleep is in unistd.h;
# pace_times is in sys/times.h;
# pace_wait, pace_waitpid are in wait.h;
POSIX_MP_FILES = \
  unistd \
  assert \
  stdlib \
  locale \
  sys/times \
  sys/wait
# POSIX_SIGNALS Unit of Functionality (POSIX.1)
# pace_abort is in stdlib.h;
# pace_alarm is in unistd.h;
# pace_kill is in signal.h;
# pace_pause is in unistd.h;
# pace_sigaction, pace_sigaddset, pace_sigdelset, pace_sigemptyset,
#  pace_sigfillset, pace_sigismember are in signal.h;
# pace_siglongjmp is in setjmp.h;
# pace_sigpending, pace_sigprocmask are in signal.h;
# pace_sigsetjmp is in setjmp.h;
# pace_sigsuspend is in signal.h;
POSIX_SIG_FILES = \
  stdlib \
  unistd \
  signal \
  setjmp
# POSIX_USER_GROUPS Unit of Functionality (POSIX.1)
# pace_getegid, pace_geteuid, pace_getgid, pace_getgroups, pace_getlogin,
#  pace_getpgrp, pace_getuid, pace_setgid, pace_setsid, pace_setuid are in
#  unistd.h;
POSIX_UG_FILES = \
  unistd
# POSIX_FILE_SYSTEM Unit of Functionality (POSIX.1)
# pace_access, pace_chdir are in unistd.h;
# pace_closedir is in dirent.h;
# pace_creat is in fcntl.h;
# pace_fpathconf is in unistd.h;
# pace_fstat is in sys/stat.h
# pace_getcwd, pace_link are in unistd.h
# pace_mkdir is in sys/stat.h
# pace_opendir is in dirent.h;
# pace_pathconf is in unistd.h;
# pace_readdir is in dirent.h;
# pace_remove, pace_rename are in stdio.h;
# pace_rewinddir is in dirent.h;
# pace_rmdir is in unistd.h;
# pace_stat is in sys/stat.h;
# pace_tmpfile, pace_tmpnam are in stdio.h;
# pace_unlink is in unistd.h;
# pace_utime is in utime.h;
POSIX_FS_FILES = \
  unistd \
  dirent \
  fcntl \
  sys/stat \
  stdio \
  utime
# POSIX_FILE_ATTRIBUTES Unit of Functionality (POSIX.1)
# pace_chmod is in sys/stat.h;
# pace_chown is in unistd.h;
# pace_umask is in sys/stat.h;
POSIX_FA_FILES = \
  sys/stat \
  unistd
# POSIX_FIFO Unit of Functionality (POSIX.1)
# pace_mkfifo is in sys/stat.h;
POSIX_F_FILES = \
  sys/stat
# POSIX_DEVICE_IO Unit of Functionality (POSIX.1)
# pace_clearerr is in stdio.h;
# pace_close is in unistd.h;
# pace_fclose, pace_fdopen, pace_feof, pace_ferror are in stdio.h;
# pace_fflush, pace_fgetc, pace_fgets, pace_fileno are in stdio.h;
# pace_fopen, pace_fprintf, pace_fputc, pace_fputs, pace_fread, pace_freopen,
#  pace_fscanf, pace_fwrite, pace_getc, pace_getchar, pace_gets are in stdio.h;
# pace_open is in fcntl.h;
# pace_perror, pace_printf, pace_putc, pace_putchar, pace_puts are in stdio.h;
# pace_read is in unistd.h;
# pace_scanf is in stdio.h;
# pace_setbuf, pace_sprintf, pace_sscanf, pace_ungetc are in stdio.h;
# pace_write are in unistd.h;
POSIX_DI_FILES = \
  stdio \
  unistd \
  fcntl
# POSIX_FD_MGMT Unit of Functionality (POSIX.1)
# pace_dup, pace_dup2 are in unistd.h;
# pace_fcntl is in fcntl.h;
# pace_fseek, pace_ftell are in stdio.h;
# pace_lseek in unistd.h;
# pace_rewind is in stdio.h;
POSIX_FM_FILES = \
  unistd \
  fcntl \
  stdio
# POSIX_PIPE Unit of Functionality (POSIX.1)
# pace_pipe is in unistd.h;
POSIX_P_FILES = \
  unistd
# POSIX_DEVICE_SPECIFIC Unit of Functionality (POSIX.1)
# pace_cfgetispeed, pace_cfgetospeed, pace_cfsetispeed, pace_cfsetospeed are
#  in termios.h;
# pace_ctermid is in stdio.h;
# pace_isatty is in unistd.h;
# pace_tcdrain, pace_tcflow, pace_tcflush, pace_tcgetattr, pace_tcsendbreak,
#  pace_tcsetattr are in termios.h;
# pace_ttyname is in unistd.h;
POSIX_DS_FILES = \
  termios \
  stdio \
  unistd
# POSIX_SYSTEM_DATABASE Unit of Functionality (POSIX.1)
# pace_getgrgid, pace_getgrnam, pace_getpwnam, pace_getpwuid are in grp.h;
POSIX_SD_FILES = \
  grp
# POSIX_C_LANG_SUPPORT Unit of Functionality (POSIX.1)
# Character handling functions (e.g., isalnum, toupper) are in ctype.h;
# Mathematics functions (e.g., acos, tanh) are in math.h;
# Non-local jump functions (i.e., longjmp, setjmp) are in setjmp.h;
# General utility functions (i.e., abs, srand) are in stdlib.h;
# String handling functions (i.e., strcat, strtok) are in string.h;
# Date and Time functions (i.e., asctime, tzset) are in time.h;
POSIX_CLS_FILES = \
  ctype \
  math \
  setjmp \
  stdlib \
  time
# _POSIX_JOB_CONTROL Unit of Functionality (POSIX.1)
# pace_setpgid is in unistd.h;
# pace_tcgetpgrp, pace_tcsetpgrp are in termios.h
_POSIX_JC_FILES = \
  unistd \
  termios
# POSIX_USER_GROUPS_R Unit of Functionality (POSIX.1)
# pace_getlogin_r is in unistd.h;
POSIX_UGR_FILES = \
  unistd
# POSIX_FILE_LOCKING Unit of Functionality (POSIX.1)
# pace_flockfile, pace_ftrylockfile, pace_funlockfile, pace_getc_unlocked,
# pace_getchar_unlocked, pace_putc_unlocked, pace_putchar_unlocked are in
# stdio.h;
POSIX_FL_FILES = \
  stdio
# POSIX_C_LANG_SUPPORT_R Unit of Functionality (POSIX.1)
# pace_asctime_r, pace_ctime_r, pace_gmtime_r, pace_localtime_r are in time.h;
# pace_rand_r is in stdlib.h;
# pace_strtok_r is in string.h;
# pace_readdir_r is in dirent.h;
POSIX_CLSR_FILES = \
  time \
  stdlib \
  string \
  dirent
# POSIX_SYSTEM_DATABASE_R Unit of Functionality (POSIX.1)
# pace_getgrgid_r, pace_getgrnam_r are in grp.h;
# pace_getpwnam_r, pace_getpwuid_r are in pwd.h;
POSIX_SDR_FILES = \
  grp \
  pwd

#----------------------------------------------------------------------------
#       Include macros and targets
#----------------------------------------------------------------------------

include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU

INCLDIRS += -I$(PACE_ROOT)

####
#### Build customization.
####
ifndef PACE_COMPONENTS
  #### Do we want PACE subsets as below? If so, we need to add the
  #### documentation referenced below as well.
  #### Please see docs/PACE-subsets.html for documentation. ??
  PACE_COMPONENTS = \
    Pace \
    Config \
    Sys
  CFLAGS += -DPACE_HAS_ALL_POSIX_FUNCS
endif # PACE_COMPONENTS

ifeq (FOR_ACE,$(PACE_COMPONENTS))
  #### These PACE components are necessary to support ACE.
  override PACE_COMPONENTS = \
    Pace \
    Config \
    Sys
  CFLAGS += -DPACE_HAS_ALL_POSIX_FUNCS
else  # ! FOR_ACE
  #### Is there anything in PACE that ACE doesn't need? Probably not
endif # ! FOR_ACE

####
#### PACE_COMPONENTS support.
####
ifneq (,$(findstring Pace,$(PACE_COMPONENTS)))
  FILES += $(PACE_FILES)
endif # Pace

ifneq (,$(findstring Config,$(PACE_COMPONENTS)))
  FILES += $(CONFIG_FILES)
endif # Config

ifneq (,$(findstring Sys,$(PACE_COMPONENTS)))
  FILES += $(SYS_FILES)
endif # Sys

ifneq (,$(findstring Posix_sp,$(PACE_COMPONENTS)))
  FILES = $(POSIX_SP_FILES)
  LIB   = libPACE_SP.a
  SHLIB = libPACE_SP.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_SP_UOF
endif # Single Process

ifneq (,$(findstring Posix_mp,$(PACE_COMPONENTS)))
  FILES = $(POSIX_MP_FILES)
  LIB   = libPACE_MP.a
  SHLIB = libPACE_MP.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_MP_UOF
endif # Multi Process

ifneq (,$(findstring Posix_sig,$(PACE_COMPONENTS)))
  FILES = $(POSIX_SIG_FILES)
  LIB   = libPACE_S.a
  SHLIB = libPACE_S.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_SIG_UOF
endif # Signals

ifneq (,$(findstring Posix_usg,$(PACE_COMPONENTS)))
  FILES = $(POSIX_UG_FILES)
  LIB   = libPACE_UG.a
  SHLIB = libPACE_UG.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_UG_UOF
endif # User Groups

ifneq (,$(findstring Posix_fs,$(PACE_COMPONENTS)))
  FILES = $(POSIX_FS_FILES)
  LIB   = libPACE_FS.a
  SHLIB = libPACE_FS.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_FS_UOF
endif # File System

ifneq (,$(findstring Posix_fa,$(PACE_COMPONENTS)))
  FILES = $(POSIX_FA_FILES)
  LIB   = libPACE_FA.a
  SHLIB = libPACE_FA.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_FA_UOF
endif # File Attributes

ifneq (,$(findstring Posix_fif,$(PACE_COMPONENTS)))
  FILES = $(POSIX_F_FILES)
  LIB   = libPACE_F.a
  SHLIB = libPACE_F.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_F_UOF
endif # Fifo

ifneq (,$(findstring Posix_di,$(PACE_COMPONENTS)))
  FILES = $(POSIX_DI_FILES)
  LIB   = libPACE_DI.a
  SHLIB = libPACE_DI.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_DI_UOF
endif # Device Input/Output

ifneq (,$(findstring Posix_fm,$(PACE_COMPONENTS)))
  FILES = $(POSIX_FM_FILES)
  LIB   = libPACE_FM.a
  SHLIB = libPACE_FM.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_FM_UOF
endif # File Descriptor Management

ifneq (,$(findstring Posix_p,$(PACE_COMPONENTS)))
  FILES = $(POSIX_P_FILES)
  LIB   = libPACE_P.a
  SHLIB = libPACE_P.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_P_UOF
endif # Pipe

ifneq (,$(findstring Posix_ds,$(PACE_COMPONENTS)))
  FILES = $(POSIX_DS_FILES)
  LIB   = libPACE_DS.a
  SHLIB = libPACE_DS.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_DS_UOF
endif # Device Specific

ifneq (,$(findstring Posix_sd,$(PACE_COMPONENTS)))
  FILES = $(POSIX_SD_FILES)
  LIB   = libPACE_SD.a
  SHLIB = libPACE_SD.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_SD_UOF
endif # System Database

ifneq (,$(findstring Posix_cls,$(PACE_COMPONENTS)))
  FILES = $(POSIX_CLS_FILES)
  LIB   = libPACE_CLS.a
  SHLIB = libPACE_CLS.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_CLS_UOF
endif # C Language Support

ifneq (,$(findstring Posix_jc,$(PACE_COMPONENTS)))
  FILES = $(_POSIX_JC_FILES)
  LIB   = libPACE_JC.a
  SHLIB = libPACE_JC.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_JC_UOF
endif # Job Control

ifneq (,$(findstring Posix_ugr,$(PACE_COMPONENTS)))
  FILES = $(POSIX_UGR_FILES)
  LIB   = libPACE_UGR.a
  SHLIB = libPACE_UGR.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_UGR_UOF
endif # User Groups - Reentrant

ifneq (,$(findstring Posix_fl,$(PACE_COMPONENTS)))
  FILES = $(POSIX_FL_FILES)
  LIB   = libPACE_FL.a
  SHLIB = libPACE_FL.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_FL_UOF
endif # File Locking

ifneq (,$(findstring Posix_clr,$(PACE_COMPONENTS)))
  FILES = $(POSIX_CLSR_FILES)
  LIB   = libPACE_CLSR.a
  SHLIB = libPACE_CLSR.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_CLSR_UOF
endif # C Language Support - Reentrant

ifneq (,$(findstring Posix_sr,$(PACE_COMPONENTS)))
  FILES = $(POSIX_SDR_FILES)
  LIB   = libPACE_SDR.a
  SHLIB = libPACE_SDR.$(SOEXT)
  CFLAGS += -DPACE_HAS_POSIX_SDR_UOF
endif # System Database - Reentrant

LSRC  = $(addsuffix .cpp,$(FILES))

BUILD += PACE_COMPONENTS

#### Setting PACELIB to null allows it to be used for building shared
#### libraries, including libPACE.$(SOEXT,) on certain platforms.
PACELIB =

include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
#### Disable installs in this ($(ACE_ROOT)/pace/pace) directory, because this
#### is the (default) destination of installs anyways.  This line prevents
#### creation of a link from the PACE library to itself when the build of
#### the PACE library fails.
INSTALL =
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU

include $(ACE_ROOT)/PACE/include/makeinclude/rules.common.GNU

#----------------------------------------------------------------------------
#       Local targets
#----------------------------------------------------------------------------

.PHONY: PACE_COMPONENTS
PACE_COMPONENTS:
	@sh $(ACE_ROOT)/bin/ace_components --pace --set ' $(PACE_COMPONENTS) '

realclean:
	@sh $(ACE_ROOT)/bin/ace_components --pace --remove

# AIX template compilation speedup hack
# Not added for PACE - can always be added later if needed

#----------------------------------------------------------------------------
#       Dependencies
#----------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.