1 # Set the proper macros based on whether we are making the debugging version
2 # or not. The valid parameters to this file are:
4 # DEBUG=1 ==> enable the making of the DBUG version
5 # DBMALLOC=1 ==> enable DBUG version with extensive MALLOC checking
7 # DB_CFLAGS ==> CFLAGS is set to this value at the end if DEBUG=1
8 # DB_LDFLAGS ==> LDFLAGS is set to this at the end if DEBUG=1
9 # DB_LDLIBS ==> LDLIBS is set to this at end if DEBUG=1
11 # The non debug versions of the above three macros are:
17 # One of the set of three should have values set appropriately prior to
22 DB_CFLAGS
+= -Idbug
/dbug
24 .SETDIR
=dbug
/dbug
: $(DBUG_SRC
)
26 # If DBMALLOC is requested (ie non-NULL) then include the sources for
27 # compilation. BSD 4.3 needs the getwd.c source compiled in due to a bug
28 # in the clib getwd routine.
30 # Serious bug in bsd43 getwd.c would free a string and then use its
31 # value. The DBMALLOC code clears a string when it is free'd so the
32 # value was no longer valid and the returned path for the current
33 # directory was now completely wrong.
34 .IF
$(OSRELEASE
) == bsd43
36 .SETDIR
=dbug
: $(GETWD_SRC
)
39 MLC_SRC
+= malloc.c free.c realloc.c calloc.c string.c\
40 mlc_chk.c mlc_chn.c memory.c tostring.c m_perror.c\
41 m_init.c mallopt.c dump.c
43 .SETDIR
=dbug
/malloc
: $(MLC_SRC
)
45 DB_CFLAGS
+= -Idbug
/malloc
48 SRC
+= $(DBUG_SRC
) $(MLC_SRC
) $(GETWD_SRC
)
51 LDFLAGS
+= $(DB_LDFLAGS
)
52 LDLIBS
+= $(DB_LDLIBS
)
54 __.SILENT
!:= $(.SILENT
)
57 OBJDIR
:= $(OBJDIR
).dbg
58 .SILENT
!:= $(__.SILENT
)
60 CFLAGS
+= $(DB_CFLAGS
)
61 .KEEP_STATE
:= _dbstate.mk
63 CFLAGS
+= $(NDB_CFLAGS
)
64 LDFLAGS
+= $(NDB_LDFLAGS
)
65 LDLIBS
+= $(NDB_LDLIBS
)