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
|
# --------------------------------------------------------
# Tcl-GDBI Makefile
#
# Getting this to work:
# Edit section II to suite your needs.
# Find your operating system from section III, uncomment it,
# comment out the other operating systems, and modify the
# paths as necessary.
# Then type
# make clean ; make
#
# $Id: Makefile,v 1.12 2000/01/14 17:47:03 tdarugar Exp $
# --------------------------------------------------------
# --------------------------------------------------------
# Section I:
SRC = sql-mysql.cc sql.cc sql-manager.cc
OBJ_DIR = obj
OBJS = $(SRC:%.cc=$(OBJ_DIR)/%.o)
# --------------------------------------------------------
# -- Configurable parameters: ----------------------------
# Section II:
CC = g++
LD = g++
FLAGS = -Wall
# include the path to your libmysqlclient as one of the -L's
LD_FLAGS = -L/usr/lib/mysql -L/usr/lib/tcl8.3 -lmysqlclient
# include path to mysql includes
INCLUDE = -I/usr/include/mysql -I/usr/include/tcl8.3
# --------------------------------------------------------
# Section III
# --------------------------------------------------------
# Linux:
EXTRA_FLAGS = -fPIC
EXTRA_LD_FLAGS = -shared -lgcc
# On some versions of linux you might need to add the following to
# EXTRA_FLAGS and EXTRA_LD_FLAGS:
# -u __divdi3 -u __moddi3
# --------------------------------------------------------
# Solaris:
#EXTRA_FLAGS = -fPIC -shared
#EXTRA_LD_FLAGS = -L/usr/local/mysql -lnsl -lsocket -shared
#LD = ld
# You will need to modify the following paths to your libmysqlclient.so
# and libgcc.a
#EXTRA_LINKS = /usr/local/mysql/lib/libmysqlclient.a \
# /opt/GCC2721/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.1/libgcc.a
# --------------------------------------------------------
# FreeBSD:
# CC = cc
# EXTRA_LD_FLAGS = -lg++ -lstdc++ -lm -lgcc_pic
# --------------------------------------------------------
# You shouldn't need to modify anything below this line.
#
CURDATE = `date +%y%m%d`
.SUFFIXES: .o .cc
all: sql.so
$(OBJ_DIR)/%.o: %.cc
$(CC) -c $(INCLUDE) $(EXTRA_FLAGS) $(FLAGS) -o $@ $<
sql.so: $(OBJS)
$(LD) $(OBJS) $(EXTRA_LINKS) $(LD_FLAGS) $(EXTRA_LD_FLAGS) -o sql.so
clean:
@ rm -f *~ $(OBJ_DIR)/*.o sql.so
@ echo "Cleaned"
|