GNUmakefile 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. ############################################################################
  2. # vim: filetype=sh:tabstop=4:tw=76
  3. #
  4. # ************ Make Variables ************
  5. #
  6. # - "VERBOSE" -or- "V" (example: 'gmake test VERBOSE=1')
  7. # Set to '1' to enable verbose build output
  8. #
  9. # ********** DUMA Configuration **********
  10. #
  11. # - Add "-DDUMA_NO_GLOBAL_MALLOC_FREE" (no quotes)
  12. # For not defining malloc / free in global namespace
  13. #
  14. # - Add "-DDUMA_EXPLICIT_INIT" (no quotes)
  15. # To do all the "risky" stuff: getenv(), sem_init(), write() ...
  16. # explicitly from main(). You must call duma_init() explicitly
  17. # from main() as well. This option avoids leak report messages
  18. # from allocations made before calling duma_init(). This helps
  19. # avoid leak warnings caused by the standard system environment.
  20. #
  21. # - Add "-DDUMA_NO_THREAD_SAFETY" (no quotes)
  22. # For not supporting multi-threading
  23. #
  24. # - Add "-DDUMA_SO_NO_CPP_SUPPORT" -or-
  25. # "-DDUMA_LIB_NO_CPP_SUPPORT" (no quotes)
  26. # For not directing new / delete to malloc / free
  27. #
  28. # - Add "-DDUMA_SO_NO_LEAKDETECTION" -or-
  29. # "-DDUMA_LIB_NO_LEAKDETECTION" (no quotes)
  30. # If you want to disable support for leak detection
  31. # (set by default when building the shared library)
  32. #
  33. # - Add "-DDUMA_SO_PREFER_ATEXIT" -or-
  34. # "-DDUMA_LIB_PREFER_ATEXIT" (no quotes)
  35. # If you prefer atexit() over the GNU compiler's function
  36. # attribute "destructor"
  37. #
  38. # - Add "-DDUMA_SO_PREFER_GETENV" -or-
  39. # "-DDUMA_LIB_PREFER_GETENV" (no quotes)
  40. # If you prefer standard C library getenv() over the global
  41. # 'char **environ'
  42. #
  43. # - Add "-DDUMA_OLD_NEW_MACRO" (no quotes)
  44. # If you want to use DUMA's old-style NEW_ELEM and NEW_ARRAY macros
  45. # When not defining this option, a standards conforming "new" syntax
  46. # can be used. Unfortunately, you have to use DEL_ELEM / DEL_ARRAY
  47. # further to utilize filename and line number of deallocation calls
  48. #
  49. # - Add "-DDUMA_SO_NO_HANG_MSG" -or-
  50. # "-DDUMA_LIB_NO_HANG_MSG" (no quotes)
  51. # Set this if you want to suppress the output from around atexit()
  52. #
  53. # - Add "-DDUMA_NO_STRERROR" (no quotes)
  54. # Set this if you want to suppress calling strerror(), which avoids
  55. # recursion on specific platforms
  56. #
  57. # - Preprocessor flags for building the shared library (DUMA_SO_LIBRARY):
  58. # * DUMA_SO_NO_CPP_SUPPORT
  59. # * DUMA_SO_NO_LEAKDETECTION
  60. # * DUMA_SO_PREFER_ATEXIT
  61. # * DUMA_SO_PREFER_GETENV
  62. # * DUMA_SO_NO_HANG_MSG
  63. #
  64. # - Preprocessor flags for building the static library:
  65. # * DUMA_LIB_NO_CPP_SUPPORT
  66. # * DUMA_LIB_NO_LEAKDETECTION
  67. # * DUMA_LIB_PREFER_ATEXIT
  68. # * DUMA_LIB_PREFER_GETENV
  69. # * DUMA_LIB_NO_HANG_MSG
  70. # * DUMA_NO_GLOBAL_MALLOC_FREE
  71. # * DUMA_EXPLICIT_INIT
  72. # * DUMA_NO_THREAD_SAFETY
  73. # * DUMA_OLD_NEW_MACRO
  74. # * DUMA_OLD_DEL_MACRO
  75. # * DUMA_NO_STRERROR
  76. #
  77. # ********** Additional DUMA Configuration **********
  78. #
  79. # - FreeBSD 5.4:
  80. # DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
  81. #
  82. # - FreeBSD 5.4 (with DUMA_EXPLICIT_INIT unset):
  83. # DUMA_OPTIONS += -DDUMA_NO_LEAKDETECTION
  84. #
  85. # - Cygwin (also define 'WIN32'):
  86. # DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  87. # also define 'WIN32'
  88. #
  89. # ********** Option Examples **********
  90. #
  91. # * DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
  92. # * DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
  93. # * DUMA_OPTIONS += -DDUMA_NO_CPP_SUPPORT
  94. #
  95. # ************** See the README.md for more information **************
  96. DUMA_OPTIONS=
  97. DUMA_OPTIONS += -DDUMA_SO_NO_LEAKDETECTION
  98. ############################################################################
  99. # Configuration: Default Settings
  100. PIC=-fPIC -DPIC
  101. DUMA_SO_OPTIONS=$(PIC) -DDUMA_SO_LIBRARY
  102. DUMA_SO_VERSION=.0.0.0
  103. CURPATH=./
  104. INSTALL=install
  105. MKDIR=mkdir -p
  106. RM=rm
  107. RMFORCE=rm -f
  108. RMDIR=rmdir
  109. ROFF=nroff
  110. ECHO=printf '%s\n'
  111. ECHOLF=printf '%s\n' ""
  112. ENV=env
  113. LN=ln -s
  114. CC=cc
  115. CXX=c++
  116. LD=ld
  117. AR=ar
  118. RANLIB=ranlib
  119. INSTALL=install
  120. DOS2UNIX=dos2unix
  121. UNAME=uname
  122. TR=tr
  123. GREP=grep
  124. TSTVAL=3072
  125. DEVNULL=/dev/null
  126. ############################################################################
  127. # Define: V / VERBOSE
  128. ifdef VERBOSE
  129. ifndef V
  130. V=$(VERBOSE)
  131. endif
  132. endif
  133. ifdef V
  134. ifndef VERBOSE
  135. VERBOSE=$(V)
  136. endif
  137. endif
  138. ############################################################################
  139. # Define: VERBAN
  140. ifneq ($(VERBOSE), 1)
  141. VERBAN=DUMA_DISABLE_BANNER=1
  142. else
  143. VERBAN=
  144. endif
  145. ############################################################################
  146. # Define: VECHO
  147. ifneq ($(VERBOSE), 1)
  148. VECHO=$(ECHO)
  149. else
  150. VECHO=true
  151. endif
  152. ############################################################################
  153. # Define: Automatic OS detection
  154. ifndef $(OS)
  155. OS=$(shell $(UNAME) -s 2> $(DEVNULL) | \
  156. $(TR) '[:upper:]' '[:lower:]' 2> $(DEVNULL))
  157. endif
  158. ############################################################################
  159. # Define: Automatic GNU Makefile path detection
  160. mkfile_name := $(abspath $(lastword $(MAKEFILE_LIST)))
  161. mkfile_path := $(dir $(mkfile_name))
  162. ############################################################################
  163. # Define: DUMA dynamic dependencies
  164. DUMA_DYN_DEPS=$(DUMASO) \
  165. tstheap_so$(EXEPOSTFIX) \
  166. dumatestpp_so$(EXEPOSTFIX) \
  167. thread-test_so$(EXEPOSTFIX)
  168. ############################################################################
  169. # Configuration: Windows (MSYS) - Command Prompt
  170. ifeq ($(OS), windows_nt)
  171. ifeq ($(OSTYPE), msys)
  172. $(info *** Using configuration: OS=windows_nt, OSTYPE=msys)
  173. # DUMA_EXPLICIT_INIT avoid leak reports from __w32_sharedptr_initialize()
  174. BSWITCH=101
  175. DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  176. MKDIR=md
  177. RM=del
  178. RMFORCE=del /F 2>nul
  179. RMDIR=rd /q
  180. ECHO=echo
  181. ECHOLF=echo .
  182. CURPATH=
  183. DUMA_DYN_DEPS=
  184. DUMASO=
  185. CFLAGS=-g -O0
  186. CPPFLAGS=-g -O0
  187. LIBS=
  188. EXEPOSTFIX=.exe
  189. endif
  190. ############################################################################
  191. # Configuration: Windows (MSYS) - Bourne Shell
  192. ifeq ($(OSTYPE), msys-sh)
  193. $(info *** Using configuration: OS=windows_nt, OSTYPE=msys-sh)
  194. # DUMA_EXPLICIT_INIT avoid leak reports from __w32_sharedptr_initialize()
  195. BSWITCH=102
  196. DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  197. CC=mingw32-gcc
  198. CXX=mingw32-g++ -std=c++98
  199. DUMA_DYN_DEPS=
  200. DUMASO=
  201. CFLAGS=-g -O0
  202. CPPFLAGS=-g -O0
  203. LIBS=
  204. EXEPOSTFIX=.exe
  205. endif
  206. ############################################################################
  207. # Configuration: Windows (Cygwin)
  208. ifeq ($(OSTYPE), cygwin)
  209. $(info *** Using configuration: OS=windows_nt, OSTYPE=cygwin)
  210. BSWITCH=103
  211. DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  212. DUMA_DYN_DEPS=
  213. DUMASO=
  214. CFLAGS=-g -O0 -DWIN32
  215. CPPFLAGS=-g -O0 -DWIN32
  216. LIBS=
  217. EXEPOSTFIX=.exe
  218. endif
  219. ############################################################################
  220. # Configuration: Windows NT
  221. ifndef BSWITCH
  222. $(info *** Using configuration: OS=windows_nt)
  223. BSWITCH=100
  224. DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  225. DUMA_DYN_DEPS=
  226. DUMASO=
  227. CFLAGS=-g -O0 -DWIN32
  228. CPPFLAGS=-g -O0 -DWIN32
  229. LIBS=
  230. EXEPOSTFIX=.exe
  231. endif
  232. endif
  233. ############################################################################
  234. # Configuration: Darwin (macOS X)
  235. ifeq ($(OS), darwin)
  236. $(info *** Using configuration: OS=darwin)
  237. BSWITCH=210
  238. DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS
  239. DUMA_OPTIONS += -DDUMA_SO_PREFER_GETENV
  240. # DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION
  241. # DUMA_DYN_DEPS=
  242. DUMASO=libduma.dylib
  243. DUMASO_LINK1=libduma.dylib
  244. CFLAGS=-g -O0
  245. CPPFLAGS=-g -O0
  246. LIBS=-lpthread
  247. EXEPOSTFIX=
  248. prefix?=/opt/duma
  249. endif
  250. ############################################################################
  251. # Configuration: FreeBSD
  252. ifeq ($(OS), freebsd)
  253. $(info *** Using configuration: OS=freebsd)
  254. BSWITCH=310
  255. # DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY
  256. DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
  257. DUMA_DYN_DEPS=
  258. DUMASO=
  259. DUMASO_LINK1=
  260. CFLAGS=-g -O0
  261. CPPFLAGS=-g -O0
  262. LIBS=-lpthread
  263. EXEPOSTFIX=
  264. endif
  265. ############################################################################
  266. # Configuration: NetBSD
  267. ifeq ($(OS), netbsd)
  268. $(info *** Using configuration: OS=netbsd)
  269. BSWITCH=320
  270. DUMASO=libduma.so$(DUMA_SO_VERSION)
  271. DUMASO_LINK1=libduma.so.0
  272. DUMASO_LINK2=libduma.so
  273. CFLAGS=-g -O0
  274. CPPFLAGS=-g -O0
  275. LIBS=-lpthread
  276. EXEPOSTFIX=
  277. endif
  278. ############################################################################
  279. # Configuration: Solaris
  280. ifeq ($(OS), solaris)
  281. $(info *** Using configuration: OS=solaris)
  282. BSWITCH=410
  283. DUMA_OPTIONS += -DDUMA_NO_STRERROR
  284. DUMA_DYN_DEPS=
  285. DUMASO=libduma.so$(DUMA_SO_VERSION)
  286. DUMASO_LINK1=libduma.so.0
  287. DUMASO_LINK2=libduma.so
  288. CFLAGS=-g -O0
  289. CPPFLAGS=-g -O0
  290. LDFLAGS += -lgcc_s
  291. LDOPTIONS += -lgcc_s
  292. LIBS=-Wl,-R/opt/sfw/lib -lpthread
  293. EXEPOSTFIX=
  294. endif
  295. ############################################################################
  296. # Configuration: Linux (detect compiler)
  297. ifeq ($(OS), linux)
  298. ifeq ($(shell $(CXX) -v 2>&1 | $(GREP) -c "clang version" 2> $(DEVNULL)), 1)
  299. COMPILERX := clang++
  300. else
  301. COMPILERX := g++ -std=c++98
  302. endif
  303. export COMPILERX
  304. ifeq ($(shell $(CC) -v 2>&1 | $(GREP) -c "clang version" 2> $(DEVNULL)), 1)
  305. COMPILER := clang
  306. else
  307. COMPILER := gcc
  308. endif
  309. export COMPILER
  310. CC=${COMPILER}
  311. CXX=${COMPILERX}
  312. $(info *** Using CC=${COMPILER})
  313. $(info *** Using CXX=${COMPILERX})
  314. ifeq ($(OSTYPE), pie)
  315. ############################################################################
  316. # Configuration: Linux (PIE)
  317. $(info *** Using configuration: OS=linux, OSTYPE=pie)
  318. CC=${COMPILER} -fpie -fPIE
  319. CXX=${COMPILERX} -fpie -fPIE
  320. BSWITCH=510
  321. else
  322. ############################################################################
  323. # Configuration: Linux (common, glibc)
  324. $(info *** Using configuration: OS=linux)
  325. CC=${COMPILER}
  326. CXX=${COMPILERX}
  327. BSWITCH=610
  328. endif
  329. DUMA_OPTIONS += -DDUMA_NO_STRERROR
  330. DUMASO=libduma.so$(DUMA_SO_VERSION)
  331. DUMASO_LINK1=libduma.so.0
  332. DUMASO_LINK2=libduma.so
  333. CFLAGS=-g -O0 -Wall -Wextra
  334. CFLAGS+=-U_FORTIFY_SOURCE
  335. CPPFLAGS=-g -O0 -Wall -Wextra
  336. CPPFLAGS+=-U_FORTIFY_SOURCE
  337. LIBS=-lpthread
  338. EXEPOSTFIX=
  339. endif
  340. ############################################################################
  341. # Configuration: Generic UNIX
  342. ifndef BSWITCH
  343. BSWITCH=810
  344. $(warning ****** Using generic UNIX fallback configuration ******)
  345. ifndef OS
  346. $(warning ****** OS unset ******)
  347. else
  348. $(warning ****** Unknown OS ******)
  349. endif
  350. DUMASO=libduma.so$(DUMA_SO_VERSION)
  351. DUMASO_LINK1=libduma.so.0
  352. DUMASO_LINK2=libduma.so
  353. CFLAGS=-g -O0
  354. CPPFLAGS=-g -O0
  355. LIBS=-lpthread
  356. EXEPOSTFIX=
  357. endif
  358. ############################################################################
  359. # Define: HOST_CFLAGS
  360. ifndef HOST_CFLAGS
  361. HOST_CFLAGS=$(CFLAGS)
  362. endif
  363. ############################################################################
  364. # Define: CC_FOR_BUILD
  365. ifndef CC_FOR_BUILD
  366. CC_FOR_BUILD=$(CC)
  367. endif
  368. ############################################################################
  369. # Define: Default prefix
  370. ifndef prefix
  371. prefix=/usr
  372. $(info *** Using default prefix [$(prefix)])
  373. endif
  374. ############################################################################
  375. # Define: Default documentation installation prefix
  376. MAN_INSTALL_DIR=$(prefix)/share/man/man3
  377. DOC_INSTALL_DIR=$(prefix)/share/doc/duma
  378. ############################################################################
  379. # Define: Default srcdir
  380. ifndef srcdir
  381. ifdef mkfile_path
  382. srcdir=$(mkfile_path)
  383. $(info *** Using default srcdir [$(srcdir)])
  384. endif
  385. endif
  386. ifndef srcdir
  387. srcdir=./
  388. $(info *** Using fallback srcdir [$(srcdir)])
  389. endif
  390. ############################################################################
  391. # Define: VPATHs (GNU Make search paths)
  392. vpath %.3 $(srcdir) $(CURDIR)
  393. vpath %.cat $(srcdir) $(CURDIR)
  394. vpath %.$(exec_prefix) $(srcdir) $(srcdir)src $(srcdir)tests $(CURDIR)
  395. vpath %.$(EXEPOSTFIX) $(srcdir) $(srcdir)src $(srcdir)tests $(CURDIR)
  396. vpath %.h $(srcdir) $(srcdir)src $(srcdir)tests $(CURDIR)
  397. vpath %.cpp $(srcdir) $(srcdir)src $(srcdir)tests $(CURDIR)
  398. vpath %.c $(srcdir) $(srcdir)src $(srcdir)tests $(CURDIR)
  399. ############################################################################
  400. # Define: Default exec_prefix
  401. ifndef exec_prefix
  402. exec_prefix=$(prefix)
  403. $(info *** Using default exec_prefix [$(exec_prefix)])
  404. endif
  405. ############################################################################
  406. # Define: Default bindir
  407. ifndef bindir
  408. bindir=$(exec_prefix)/bin
  409. endif
  410. ############################################################################
  411. # Define: Default datadir
  412. ifndef datadir
  413. datadir=$(prefix)/share
  414. endif
  415. ############################################################################
  416. # Define: Default sysconfdir
  417. ifndef sysconfdir
  418. sysconfdir=$(prefix)/etc
  419. endif
  420. ############################################################################
  421. # Define: Default libdir
  422. ifndef libdir
  423. libdir=$(exec_prefix)/lib
  424. endif
  425. ############################################################################
  426. # Define: Default includedir
  427. ifndef includedir
  428. includedir=$(prefix)/include
  429. endif
  430. ############################################################################
  431. # Define: Package source files
  432. PACKAGE_SOURCE=$(srcdir)README.md \
  433. $(srcdir)CHANGELOG.md \
  434. $(srcdir)LICENSE \
  435. $(srcdir)COPYING-GPL \
  436. $(srcdir)COPYING-LGPL \
  437. $(srcdir)duma.3 \
  438. $(srcdir)GNUmakefile \
  439. $(srcdir)gdbinit.rc \
  440. $(srcdir)duma.h \
  441. $(srcdir)dumapp.h \
  442. $(srcdir)duma_sem.h \
  443. $(srcdir)paging.h \
  444. $(srcdir)print.h \
  445. $(srcdir)duma_hlp.h \
  446. $(srcdir)noduma.h \
  447. $(srcdir)src/duma.c \
  448. $(srcdir)src/dumapp.cpp \
  449. $(srcdir)src/sem_inc.c \
  450. $(srcdir)src/print.c \
  451. $(srcdir)tests/dumatest.c \
  452. $(srcdir)tests/tstheap.c \
  453. $(srcdir)tests/thread-test.c \
  454. $(srcdir)tests/testmt.c \
  455. $(srcdir)tests/dumatestpp.cpp \
  456. $(srcdir)tests/testoperators.cpp \
  457. $(srcdir)createconf.c \
  458. $(srcdir)make_git_source_version.sh
  459. ############################################################################
  460. # Define: OBJECTS
  461. OBJECTS=dumapp.o \
  462. duma.o \
  463. sem_inc.o \
  464. print.o
  465. ############################################################################
  466. # Define: SO_OBJECTS
  467. SO_OBJECTS=dumapp_so.o \
  468. duma_so.o \
  469. sem_inc_so.o \
  470. print_so.o
  471. ############################################################################
  472. # Target: "all" (default)
  473. .PHONY: all
  474. all: verinfo.h \
  475. libduma.a \
  476. $(DUMA_DYN_DEPS)
  477. @ $(ECHO) "*** Build complete"
  478. ############################################################################
  479. # Target: "check" / "test"
  480. .PHONY: check test
  481. check test: libduma.a \
  482. tstheap$(EXEPOSTFIX) \
  483. dumatest$(EXEPOSTFIX) \
  484. thread-test$(EXEPOSTFIX) \
  485. testmt$(EXEPOSTFIX) \
  486. dumatestpp$(EXEPOSTFIX) \
  487. testoperators$(EXEPOSTFIX) \
  488. testmemlimit$(EXEPOSTFIX) \
  489. $(DUMA_DYN_DEPS)
  490. @ $(ECHOLF)
  491. @ $(ECHO) "*** Testing DUMA (static library)"
  492. @ $(VECHO) " *** Test: dumatest"
  493. @ $(VERBAN) "$(CURPATH)dumatest$(EXEPOSTFIX)"
  494. @ $(VECHO) " *** Test: dumatestpp"
  495. @ $(VERBAN) "$(CURPATH)dumatestpp$(EXEPOSTFIX)"
  496. @ $(VECHO) " *** Test: tstheap $(TSTVAL)"
  497. @ $(VERBAN) "$(CURPATH)tstheap$(EXEPOSTFIX)" "$(TSTVAL)"
  498. @ $(VECHO) " *** Test: thread-test"
  499. @ $(VERBAN) "$(CURPATH)thread-test$(EXEPOSTFIX)" > $(DEVNULL)
  500. # @ $(VECHO) " *** Test: testmt"
  501. # @ $(VERBAN) "$(CURPATH)testmt$(EXEPOSTFIX)"
  502. @ $(VECHO) " *** Test: testoperators"
  503. @ $(VERBAN) "$(CURPATH)testoperators$(EXEPOSTFIX)"
  504. @ $(VECHO) " *** Test: testmemlimit"
  505. @ $(VERBAN) "$(CURPATH)testmemlimit$(EXEPOSTFIX)"
  506. @ $(ECHO) "*** DUMA static confidence test PASSED."
  507. ifdef DUMASO
  508. @ $(ECHOLF)
  509. @ $(ECHO) "*** Testing DUMA (dynamic library)"
  510. @ $(VECHO) " *** Test: dumatestpp_so"
  511. ifeq ($(OS), solaris)
  512. @ LD_PRELOAD="./$(DUMASO)" \
  513. DYLD_INSERT_LIBRARIES="./$(DUMASO)" \
  514. DYLD_FORCE_FLAT_NAMESPACE=1 \
  515. $(VERBAN) exec "$(CURPATH)dumatestpp_so$(EXEPOSTFIX)" \
  516. "$(TSTVAL)"
  517. else
  518. @ (export LD_PRELOAD="./$(DUMASO)"; \
  519. export DYLD_INSERT_LIBRARIES="./$(DUMASO)"; \
  520. export DYLD_FORCE_FLAT_NAMESPACE=1 ; \
  521. $(VERBAN) exec "$(CURPATH)dumatestpp_so$(EXEPOSTFIX)" \
  522. "$(TSTVAL)")
  523. endif
  524. @ $(VECHO) " *** Test: tstheap_so $(TSTVAL)"
  525. ifeq ($(OS), solaris)
  526. @ LD_PRELOAD="./$(DUMASO)" \
  527. DYLD_INSERT_LIBRARIES="./$(DUMASO)" \
  528. DYLD_FORCE_FLAT_NAMESPACE=1 \
  529. $(VERBAN) exec "$(CURPATH)tstheap_so$(EXEPOSTFIX)" \
  530. "$(TSTVAL)"
  531. else
  532. @ (export LD_PRELOAD="./$(DUMASO)"; \
  533. export DYLD_INSERT_LIBRARIES="./$(DUMASO)"; \
  534. export DYLD_FORCE_FLAT_NAMESPACE=1 ; \
  535. $(VERBAN) exec "$(CURPATH)tstheap_so$(EXEPOSTFIX)" \
  536. "$(TSTVAL)")
  537. endif
  538. @ $(VECHO) " *** Test: thread-test_so"
  539. ifeq ($(OS), solaris)
  540. @ LD_PRELOAD="./$(DUMASO)" \
  541. DYLD_INSERT_LIBRARIES="./$(DUMASO)" \
  542. DYLD_FORCE_FLAT_NAMESPACE=1 \
  543. $(VERBAN) exec "$(CURPATH)thread-test_so$(EXEPOSTFIX)" \
  544. > $(DEVNULL)
  545. else
  546. @ (export LD_PRELOAD="./$(DUMASO)"; \
  547. export DYLD_INSERT_LIBRARIES="./$(DUMASO)"; \
  548. export DYLD_FORCE_FLAT_NAMESPACE=1 ; \
  549. $(VERBAN) exec "$(CURPATH)thread-test_so$(EXEPOSTFIX)") \
  550. > $(DEVNULL)
  551. endif
  552. @ $(ECHO) "*** DUMA confidence test PASSED."
  553. @ $(ECHOLF)
  554. endif
  555. ############################################################################
  556. # Target: "installcheck" / "installtest"
  557. .PHONY: installcheck installtest
  558. installcheck installtest: test
  559. ifdef DUMASO
  560. @ $(ECHOLF)
  561. @ $(ECHO) "*** Testing installed DUMA (dynamic library):"
  562. @ $(ECHOLF)
  563. @ $(VECHO) " *** Test: tstheap_so $(TSTVAL)"
  564. @ $(VERBAN) "$(bindir)/duma" "$(CURPATH)tstheap_so" "$(TSTVAL)"
  565. @ $(ECHO) "*** DUMA installcheck test PASSED."
  566. @ $(ECHOLF)
  567. endif
  568. ############################################################################
  569. # Target: "printvars" / "printenv" (display variables of GNUmakefile)
  570. .PHONY: printvars printenv
  571. printvars printenv:
  572. @echo "OS [$(OS)]"
  573. @echo "OSTYPE [$(OSTYPE)]"
  574. @echo "bswitch [$(BSWITCH)]"
  575. @echo "srcdir [$(srcdir)]"
  576. @echo "prefix [$(prefix)]"
  577. @echo "exec_prefix [$(exec_prefix)]"
  578. @echo "bindir [$(bindir)]"
  579. @echo "datadir [$(datadir)]"
  580. @echo "sysconfdir [$(sysconfdir)]"
  581. @echo "libdir [$(libdir)]"
  582. @echo "includedir [$(includedir)]"
  583. @echo "oldincludedir [$(oldincludedir)]"
  584. @echo "CURDIR [$(CURDIR)]"
  585. @echo "MAN_INSTALL_DIR [$(MAN_INSTALL_DIR)]"
  586. @echo "DOC_INSTALL_DIR [$(DOC_INSTALL_DIR)]"
  587. @echo "VERBOSE [$(VERBOSE)]"
  588. @echo "V [$(V)]"
  589. @echo "VERBAN [$(VERBAN)]"
  590. @echo "MKDIR [$(MKDIR)]"
  591. @echo "MAKE [$(MAKE)]"
  592. @echo "CC [$(CC)]"
  593. @echo "CFLAGS [$(CFLAGS)]"
  594. @echo "CXX [$(CXX)]"
  595. @echo "CPPFLAGS [$(CPPFLAGS)]"
  596. @echo "LD [$(LD)]"
  597. @echo "AR [$(AR)]"
  598. @echo "LIBS [$(LIBS)]"
  599. @echo "RANLIB [$(RANLIB)]"
  600. @echo "INSTALL [$(INSTALL)]"
  601. @echo "RM [$(RM)]"
  602. @echo "RMFORCE [$(RMFORCE)]"
  603. @echo "RMDIR [$(RMDIR)]"
  604. @echo "VECHO [$(VECHO)]"
  605. @echo "ECHO [$(ECHO)]"
  606. @echo "ECHOLF [$(ECHOLF)]"
  607. @echo "PIC [$(PIC)]"
  608. @echo "EXEPOSTFIX [$(EXEPOSTFIX)]"
  609. @echo "CURPATH [$(CURPATH)]"
  610. @echo "DUMA_OPTIONS [$(DUMA_OPTIONS)]"
  611. @echo "DUMA_SO_OPTIONS [$(DUMA_SO_OPTIONS)]"
  612. @echo "OBJECTS [$(OBJECTS)]"
  613. @echo "SO_OBJECTS [$(SO_OBJECTS)]"
  614. @echo "DUMA_SO_VERSION [$(DUMA_SO_VERSION)]"
  615. @echo "DUMASO [$(DUMASO)]"
  616. @echo "DUMASO_LINK1 [$(DUMASO_LINK1)]"
  617. @echo "DUMASO_LINK2 [$(DUMASO_LINK2)]"
  618. @echo "DUMA_DYN_DEPS [$(DUMA_DYN_DEPS)]"
  619. @echo "PACKAGE_SOURCE [$(PACKAGE_SOURCE)]"
  620. ############################################################################
  621. # Target "printuk" (display files unknown to git)
  622. .PHONY: printuk
  623. printuk:
  624. @ $(ECHO) "*** Begin printuk (git untracked files):"
  625. @ git status -s --untracked-files="all" 2> $(DEVNULL) | \
  626. $(GREP) '^? ' || true
  627. @ $(ECHO) "*** End printuk"
  628. ############################################################################
  629. # Target: "printmod" (display files known to git but not up-to-date)
  630. .PHONY: printmod
  631. printmod:
  632. @ $(ECHO) "*** Begin printmod (git tracked modified files)"
  633. @ git status -s 2> $(DEVNULL) | \
  634. $(GREP) '^\ \?M ' || true
  635. @ $(ECHO) "*** End printmod"
  636. ############################################################################
  637. # Target: "install" (installs DUMA, respecting DESTDIR variable)
  638. .PHONY: install
  639. install: libduma.a \
  640. duma.3 \
  641. duma_config.h \
  642. $(DUMASO)
  643. - $(MKDIR) "$(DESTDIR)$(DOC_INSTALL_DIR)"
  644. $(INSTALL) -m 644 \
  645. "$(srcdir)README.md" \
  646. "$(DESTDIR)$(DOC_INSTALL_DIR)"
  647. - $(MKDIR) "$(DESTDIR)$(includedir)"
  648. $(INSTALL) -m 644 \
  649. "$(srcdir)noduma.h" \
  650. "$(srcdir)duma.h" \
  651. "$(srcdir)dumapp.h" \
  652. "$(srcdir)duma_sem.h" \
  653. "$(CURDIR)/duma_config.h" \
  654. "$(DESTDIR)$(includedir)"
  655. ifdef DUMASO
  656. - $(MKDIR) "$(DESTDIR)$(bindir)"
  657. $(INSTALL) -m 755 \
  658. "$(srcdir)duma.sh" \
  659. "$(DESTDIR)$(bindir)/duma"
  660. endif
  661. - $(MKDIR) "$(DESTDIR)$(libdir)"
  662. $(INSTALL) -m 644 \
  663. "$(CURDIR)/libduma.a" \
  664. "$(DESTDIR)$(libdir)"
  665. ifdef DUMASO
  666. $(INSTALL) -m 755 \
  667. "$(CURDIR)/$(DUMASO)" \
  668. "$(DESTDIR)$(libdir)"
  669. endif
  670. ifdef DUMASO_LINK1
  671. - $(RMFORCE) "$(DESTDIR)$(libdir)/$(DUMASO_LINK1)"
  672. $(LN) \
  673. "$(DUMASO)" \
  674. "$(DESTDIR)$(libdir)/$(DUMASO_LINK1)"
  675. endif
  676. ifdef DUMASO_LINK2
  677. - $(RMFORCE) "$(DESTDIR)$(libdir)/$(DUMASO_LINK2)"
  678. $(LN) \
  679. "$(DUMASO)" \
  680. "$(DESTDIR)$(libdir)/$(DUMASO_LINK2)"
  681. endif
  682. - $(MKDIR) "$(DESTDIR)$(MAN_INSTALL_DIR)"
  683. $(INSTALL) -m 644 \
  684. "$(srcdir)duma.3" \
  685. "$(DESTDIR)$(MAN_INSTALL_DIR)/duma.3"
  686. ############################################################################
  687. # Target: "uninstall" (uninstalls DUMA, respects DESTDIR variable)
  688. .PHONY: uninstall
  689. uninstall:
  690. - $(RMFORCE) "$(DESTDIR)$(DOC_INSTALL_DIR)/README.md"
  691. - $(RMFORCE) "$(DESTDIR)$(includedir)/noduma.h"
  692. - $(RMFORCE) "$(DESTDIR)$(includedir)/duma.h"
  693. - $(RMFORCE) "$(DESTDIR)$(includedir)/dumapp.h"
  694. - $(RMFORCE) "$(DESTDIR)$(includedir)/duma_sem.h"
  695. - $(RMFORCE) "$(DESTDIR)$(includedir)/duma_config.h"
  696. - $(RMFORCE) "$(DESTDIR)$(bindir)/duma"
  697. - $(RMFORCE) "$(DESTDIR)$(libdir)/libduma.a"
  698. ifdef DUMASO
  699. - $(RMFORCE) "$(DESTDIR)$(libdir)/$(DUMASO)"
  700. endif
  701. ifdef DUMASO_LINK1
  702. - $(RMFORCE) "$(DESTDIR)$(libdir)/$(DUMASO_LINK1)"
  703. endif
  704. ifdef DUMASO_LINK2
  705. - $(RMFORCE) "$(DESTDIR)$(libdir)/$(DUMASO_LINK2)"
  706. endif
  707. - $(RMFORCE) "$(DESTDIR)$(MAN_INSTALL_DIR)/duma.3"
  708. ############################################################################
  709. # Target: "clean" (deletes make output; saves configuration artifacts)
  710. .PHONY: clean
  711. clean:
  712. - $(RMFORCE) core a.out $(OBJECTS) \
  713. $(SO_OBJECTS) \
  714. tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o \
  715. tstheap_so.o dumatestpp_so.o testoperators.o testmemlimit.o \
  716. testmemlimit$(EXEPOSTFIX) thread-test_so$(EXEPOSTFIX) \
  717. tstheap$(EXEPOSTFIX) tstheap_so$(EXEPOSTFIX) \
  718. dumatest$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) \
  719. dumatestpp_so$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) \
  720. thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) \
  721. libduma.a $(DUMASO) thread-test_so.o libduma.cat
  722. ############################################################################
  723. # Target: "distclean" / "realclean" / "clobber" (deletes all make output)
  724. .PHONY: distclean realclean clobber clean
  725. distclean realclean clobber: clean
  726. - $(RMFORCE) duma_config.h verinfo.h createconf.o \
  727. createconf$(EXEPOSTFIX) CMakeCache.txt CMakeFiles/cmake.*cache \
  728. "$(srcdir)CMakeFiles/"cmake.*cache
  729. @ $(RMDIR) "$(srcdir)CMakeFiles" > $(DEVNULL) 2>&1 || true
  730. @ $(RMDIR) "$(CURDIR)/CMakeFiles" > $(DEVNULL) 2>&1 || true
  731. ############################################################################
  732. # Target: "libduma.cat"
  733. libduma.cat: roff
  734. ############################################################################
  735. # Target: "roff" (renders catman documentation from roff source)
  736. .PHONY: roff
  737. roff: duma.3
  738. $(ROFF) -man < "$(srcdir)duma.3" > "$(CURDIR)/libduma.cat"
  739. ############################################################################
  740. # Target: "libduma.a"
  741. libduma.a: duma_config.h \
  742. verinfo.h \
  743. $(OBJECTS)
  744. - $(RMFORCE) libduma.a
  745. $(AR) crv \
  746. libduma.a \
  747. $(OBJECTS)
  748. $(RANLIB) libduma.a
  749. ############################################################################
  750. # Target: "duma.sh"
  751. # Placeholder to process duma.sh.in to duma.sh
  752. ############################################################################
  753. # Target: "verinfo.h"
  754. verinfo.h:
  755. "$(srcdir)make_git_source_version.sh" || \
  756. $(ENV) sh "$(srcdir)make_git_source_version.sh" || \
  757. $(SHELL) "$(srcdir)make_git_source_version.sh" || \
  758. touch "$(CURPATH)verinfo.h"
  759. ############################################################################
  760. # Target: "duma_config.h"
  761. duma_config.h:
  762. $(MAKE) -f "$(mkfile_name)" reconfig
  763. ############################################################################
  764. # Target: "reconfig"
  765. .PHONY: reconfig
  766. reconfig: verinfo.h \
  767. createconf$(EXEPOSTFIX) \
  768. createconf.o \
  769. createconf.c
  770. - "$(CURPATH)createconf$(EXEPOSTFIX)"
  771. ############################################################################
  772. # Target: "dos2unix" (convert source line endings)
  773. .PHONY: dos2unix
  774. dos2unix:
  775. $(DOS2UNIX) $(PACKAGE_SOURCE)
  776. ############################################################################
  777. # Target: "createconf"
  778. createconf$(EXEPOSTFIX): createconf.o
  779. - $(RMFORCE) createconf$(EXEPOSTFIX)
  780. $(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) \
  781. createconf.o \
  782. -o createconf$(EXEPOSTFIX)
  783. ############################################################################
  784. # Target: "tstheap"
  785. tstheap$(EXEPOSTFIX): libduma.a \
  786. tstheap.o
  787. - $(RMFORCE) tstheap$(EXEPOSTFIX)
  788. $(CC) $(CFLAGS) -I"./" \
  789. tstheap.o libduma.a \
  790. -o tstheap$(EXEPOSTFIX) $(LIBS)
  791. ############################################################################
  792. # Target: "dumatest"
  793. dumatest$(EXEPOSTFIX): libduma.a \
  794. dumatest.o
  795. - $(RMFORCE) dumatest$(EXEPOSTFIX)
  796. $(CC) $(CFLAGS) -I"./" \
  797. dumatest.o libduma.a \
  798. -o dumatest$(EXEPOSTFIX) $(LIBS)
  799. ############################################################################
  800. # Target: "dumatestpp"
  801. dumatestpp$(EXEPOSTFIX): libduma.a \
  802. dumatestpp.o \
  803. duma_sem.h \
  804. dumapp.h
  805. - $(RMFORCE) dumatestpp$(EXEPOSTFIX)
  806. $(CXX) -I"./" $(CPPFLAGS) \
  807. dumatestpp.o libduma.a \
  808. -o dumatestpp$(EXEPOSTFIX) $(LIBS)
  809. ############################################################################
  810. # Target: "thread-test"
  811. thread-test$(EXEPOSTFIX): libduma.a \
  812. thread-test.o
  813. - $(RMFORCE) thread-test$(EXEPOSTFIX)
  814. $(CC) -I"./" $(CFLAGS) \
  815. thread-test.o libduma.a \
  816. -o thread-test$(EXEPOSTFIX) $(LIBS)
  817. ############################################################################
  818. # Target: "thread-test_so"
  819. thread-test_so$(EXEPOSTFIX): thread-test_so.o
  820. - $(RMFORCE) thread-test_so$(EXEPOSTFIX)
  821. $(CC) -I"./" $(CFLAGS) \
  822. thread-test_so.o \
  823. -o thread-test_so$(EXEPOSTFIX) $(LIBS)
  824. ############################################################################
  825. # Target: "testmt"
  826. testmt$(EXEPOSTFIX): libduma.a \
  827. testmt.o
  828. - $(RMFORCE) testmt$(EXEPOSTFIX)
  829. $(CC) -I"./" $(CFLAGS) \
  830. testmt.o libduma.a \
  831. -o testmt$(EXEPOSTFIX) $(LIBS)
  832. ############################################################################
  833. # Target: "testoperators"
  834. testoperators$(EXEPOSTFIX): libduma.a \
  835. testoperators.o \
  836. duma_sem.h \
  837. dumapp.h
  838. - $(RMFORCE) testoperators$(EXEPOSTFIX)
  839. $(CXX) -I"./" $(CPPFLAGS) \
  840. testoperators.o libduma.a \
  841. -o testoperators$(EXEPOSTFIX) $(LIBS)
  842. ############################################################################
  843. # Target: "testmemlimit"
  844. testmemlimit$(EXEPOSTFIX): libduma.a \
  845. testmemlimit.o
  846. - $(RMFORCE) testmemlimit$(EXEPOSTFIX)
  847. $(CC) -I"./" $(CFLAGS) \
  848. testmemlimit.o libduma.a \
  849. -o testmemlimit$(EXEPOSTFIX) $(LIBS)
  850. ############################################################################
  851. # Target: "tstheap_so"
  852. tstheap_so$(EXEPOSTFIX): tstheap_so.o
  853. - $(RMFORCE) tstheap_so$(EXEPOSTFIX)
  854. $(CC) $(CFLAGS) -I"./" \
  855. tstheap_so.o \
  856. -o tstheap_so$(EXEPOSTFIX) $(LIBS)
  857. ############################################################################
  858. # Target: "dumatestpp_so"
  859. dumatestpp_so$(EXEPOSTFIX): dumatestpp_so.o
  860. - $(RMFORCE) dumatestpp_so$(EXEPOSTFIX)
  861. $(CXX) -I"./" $(CPPFLAGS) \
  862. dumatestpp_so.o \
  863. -o dumatestpp_so$(EXEPOSTFIX) $(LIBS)
  864. ############################################################################
  865. # Target: "testmemlimit_so"
  866. testmemlimit_so$(EXEPOSTFIX): testmemlimit_so.o
  867. - $(RMFORCE) testmemlimit_so$(EXEPOSTFIX)
  868. $(CC) -I"./" $(CFLAGS) \
  869. testmemlimit_so.o \
  870. -o testmemlimit_so$(EXEPOSTFIX) $(LIBS)
  871. ############################################################################
  872. # Target: "$(OBJECTS)"
  873. $(OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o: duma.h
  874. ############################################################################
  875. # Target: "$(DUMASO)" (Windows NT)
  876. ifeq ($(OS), windows_nt)
  877. # do nothing
  878. else
  879. ifeq ($(OS), darwin)
  880. ############################################################################
  881. # Target: "$(DUMASO)" (Darwin / macOS / OS X)
  882. $(DUMASO): duma_config.h \
  883. verinfo.h \
  884. $(SO_OBJECTS)
  885. $(CXX) -g -dynamiclib -Wl \
  886. -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
  887. $(CXX) -g -dynamiclib \
  888. -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
  889. else
  890. ############################################################################
  891. # Target: "$(DUMASO)" (UNIX default)
  892. $(DUMASO): duma_config.h \
  893. verinfo.h \
  894. $(SO_OBJECTS)
  895. $(CXX) -g -shared -Wl,-soname,$(DUMASO) \
  896. -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
  897. # $(CXX) -g -shared \
  898. # -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
  899. endif
  900. endif
  901. ############################################################################
  902. # Target: "createconf.o"
  903. createconf.o:
  904. $(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) \
  905. -c "$(srcdir)"createconf.c \
  906. -o $@
  907. ############################################################################
  908. # Target: "dumapp_so.o"
  909. dumapp_so.o: src/dumapp.cpp \
  910. duma.h \
  911. duma_sem.h \
  912. dumapp.h
  913. $(CXX) -I"$(srcdir)" -I"./" $(CPPFLAGS) $(DUMA_SO_OPTIONS) \
  914. -c "$(srcdir)src/dumapp.cpp" \
  915. -o $@
  916. ############################################################################
  917. # Target: "duma_so.o"
  918. duma_so.o: src/duma.c \
  919. duma.h \
  920. duma_config.h \
  921. verinfo.h
  922. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) $(DUMA_SO_OPTIONS) \
  923. -c "$(srcdir)src/duma.c" \
  924. -o $@
  925. ############################################################################
  926. # Target: "sem_inc_so.o"
  927. sem_inc_so.o: src/sem_inc.c \
  928. duma_sem.h
  929. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) $(DUMA_SO_OPTIONS) \
  930. -c "$(srcdir)src/sem_inc.c" \
  931. -o $@
  932. ############################################################################
  933. # Target: "print_so.o"
  934. print_so.o: src/print.c \
  935. print.h
  936. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) $(DUMA_SO_OPTIONS) \
  937. -c "$(srcdir)src/print.c" \
  938. -o $@
  939. ############################################################################
  940. # Target: "tstheap_so.o"
  941. tstheap_so.o:
  942. $(CC) $(CFLAGS) -I"./" $(DUMA_SO_OPTIONS) \
  943. -c "$(srcdir)tests/tstheap.c" \
  944. -o $@
  945. ############################################################################
  946. # Target: "dumatestpp_so.o"
  947. dumatestpp_so.o:
  948. $(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) \
  949. -c "$(srcdir)tests/dumatestpp.cpp" \
  950. -o $@
  951. ############################################################################
  952. # Target: "testmemlimit_so.o"
  953. testmemlimit_so.o:
  954. $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) \
  955. -c "$(srcdir)tests/testmemlimit.c" \
  956. -o $@
  957. ############################################################################
  958. # Target: "testmemlimit.o"
  959. testmemlimit.o:
  960. $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) \
  961. -c "$(srcdir)tests/experimental/testmemlimit.c" \
  962. -o $@
  963. ############################################################################
  964. # Target: "dumapp.o"
  965. dumapp.o: src/dumapp.cpp \
  966. duma.h \
  967. duma_sem.h \
  968. dumapp.h
  969. $(CXX) -I"$(srcdir)" -I"./" $(CPPFLAGS) \
  970. -c "$(srcdir)src/dumapp.cpp" \
  971. -o $@
  972. ############################################################################
  973. # Target: "duma.o"
  974. duma.o: src/duma.c \
  975. duma.h \
  976. duma_config.h \
  977. verinfo.h
  978. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) \
  979. -c "$(srcdir)src/duma.c" \
  980. -o $@
  981. ############################################################################
  982. # Target: "sem_inc.o"
  983. sem_inc.o: src/sem_inc.c \
  984. duma_sem.h
  985. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) \
  986. -c "$(srcdir)src/sem_inc.c" \
  987. -o $@
  988. ############################################################################
  989. # Target: "print.o"
  990. print.o: src/print.c \
  991. print.h
  992. $(CC) -I"$(srcdir)" -I"./" $(CFLAGS) \
  993. -c "$(srcdir)src/print.c" \
  994. -o $@
  995. ############################################################################
  996. # Target: "dumatest.o"
  997. dumatest.o: tests/dumatest.c \
  998. duma.h \
  999. duma_config.h \
  1000. verinfo.h
  1001. $(CC) $(CFLAGS) -I"./" \
  1002. -c "$(srcdir)tests/dumatest.c" \
  1003. -o $@
  1004. ############################################################################
  1005. # Target: "dumatestpp.o"
  1006. dumatestpp.o: tests/dumatestpp.cpp \
  1007. duma.h \
  1008. duma_sem.h \
  1009. dumapp.h \
  1010. duma_config.h \
  1011. verinfo.h
  1012. $(CXX) -I"./" $(CPPFLAGS) \
  1013. -c "$(srcdir)tests/dumatestpp.cpp" \
  1014. -o $@
  1015. ############################################################################
  1016. # Target: "tstheap.o"
  1017. tstheap.o: tests/tstheap.c \
  1018. duma.h \
  1019. duma_config.h \
  1020. verinfo.h
  1021. $(CC) -I"./" $(CFLAGS) -I"./" \
  1022. -c "$(srcdir)tests/tstheap.c" \
  1023. -o $@
  1024. ############################################################################
  1025. # Target: "testoperators.o"
  1026. testoperators.o: tests/testoperators.cpp \
  1027. duma.h \
  1028. duma_sem.h \
  1029. dumapp.h \
  1030. duma_config.h \
  1031. verinfo.h
  1032. $(CXX) -I"./" $(CPPFLAGS) \
  1033. -c "$(srcdir)tests/testoperators.cpp" \
  1034. -o $@
  1035. ############################################################################
  1036. # Target: "thread-test.o"
  1037. thread-test.o: tests/thread-test.c \
  1038. duma.h \
  1039. duma_config.h \
  1040. verinfo.h
  1041. $(CC) -I"./" $(CFLAGS) \
  1042. -c "$(srcdir)tests/thread-test.c" \
  1043. -o $@
  1044. ############################################################################
  1045. # Target: "thread-test.o"
  1046. thread-test_so.o: tests/thread-test.c \
  1047. duma.h \
  1048. duma_config.h \
  1049. verinfo.h
  1050. $(CC) -I"./" $(CFLAGS) \
  1051. -c "$(srcdir)tests/thread-test.c" \
  1052. -o $@
  1053. ############################################################################
  1054. # Target: "testmt.o"
  1055. testmt.o: tests/testmt.c \
  1056. duma.h \
  1057. duma_config.h \
  1058. verinfo.h
  1059. $(CC) -I"./" $(CFLAGS) \
  1060. -c "$(srcdir)tests/testmt.c" \
  1061. -o $@
  1062. ############################################################################
  1063. # Target: FORCE
  1064. .PHONY: FORCE
  1065. FORCE:
  1066. ############################################################################
  1067. # Local Variables:
  1068. # mode: makefile
  1069. # tab-width: 4
  1070. # End: