3 CFLAGS
= $(OPTFLAGS
) -Wall
-ggdb3
5 DSOLDFLAGS
= -shared
-nostartfiles
$(SQL_LDFLAGS
)
6 SQL_LDFLAGS
= -L
/usr
/lib
/mysql
-lmysqlclient
7 TESTLDFLAGS
= -ldl
-rdynamic
-Wl
,-export-dynamic
8 OBJS
= module.o hooks.o cfgfile.o logging.o sql.o utils.o hash.o mm.o
9 TEST_OBJS
= test_utils.o utils.o hash.o mm.o
10 DEPS
= Makefile module.h cfgfile.h utils.h
15 ALL_CFLAGS
= $(CPPFLAGS
) $(CFLAGS
)
18 QUIET_CC
= @echo
' ' CC
$@
;
19 QUIET_LINK
= @echo
' ' LINK
$@
;
22 all: $(DSO
) $(TESTPROG
) import
25 @echo
"Installing to $(DESTDIR)"
26 @
test -d
$(DESTDIR
) || mkdir
-m
755 -p
$(DESTDIR
)
27 @cp
-a scripts import
$(DSO
) $(TESTPROG
) $(DESTDIR
)
28 @cp
-a db.conf
$(DESTDIR
)/ndbneb.conf
31 $(QUIET_LINK
)$(CC
) $(DSOLDFLAGS
) $^
-o
$@
33 $(TESTPROG
): $(TESTPROG
).o
$(TEST_OBJS
)
34 $(QUIET_LINK
)$(CC
) $(TESTLDFLAGS
) $^
-o
$@
36 import
: import.o
$(TEST_OBJS
) sql.o hooks.o logging.o
37 $(QUIET_LINK
)$(CC
) $(SQL_LDFLAGS
) $^
-o
$@
39 test: mod
$(TESTPROG
) $(CONFIG_FILE
)
40 .
/$(TESTPROG
) -f
$(CONFIG_FILE
) $(DSO
)
45 $(QUIET_CC
)$(CC
) -o
$*.o
-c
$(ALL_CFLAGS
) $<
49 @
$(CC
) $(CFLAGS
) $(DSOLDFLAGS
) $^
-o
$@
52 rm -f core core.
* *.
{o
,so
,out
,log
} $(TESTPROG
) import
54 #'^[^.%][A-Za-z0-9_]*:'
56 @echo Available make targets
:
57 @echo
-----------------------
58 @
$(MAKE
) --print-data-base
--question | sed
-n
-e
'/^Makefile/d' -e
's/^\([A-Za-z0-9_]*\):.*/\1/p'
64 $(TESTPROG
).o
: $(TESTPROG
).c
$(DEPS
)
65 import.o
: import.c hooks.h sql.h logging.h Makefile
66 logging.o
: logging.c logging.h
$(DEPS
)
67 cfgfile.o
: cfgfile.c cfgfile.h
68 sql.o
: sql.c sql.h
$(DEPS
)
70 hooks.o
: hooks.c sql.h hooks.h
$(DEPS
)
71 module.o
: module.c hooks.h
$(DEPS
)
72 utils.o
: utils.c utils.h