# This assumes the MySQL software is installed in /usr/local/mysql inc := /cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/include lib := /cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/lib # If you have not installed the MySQL software yet, try this instead #inc := /cygdrive/g/mysql/mysql-debug-4.0.12-pc-linux-i686/include:$(HOME)/mysql-4.0/include #lib := $(HOME)/mysql-4.0/libmysqld CC := gcc CPPFLAGS := -I$(inc) -D_THREAD_SAFE -D_REENTRANT CFLAGS := -g -W -Wall LDFLAGS := -static # You can change -lmysqld to -lmysqlclient to use the # client/server library #LDLIBS = -L$(lib) -lmysqld -lz -lm -lcrypt LDLIBS = -L$(lib) -llibmysqlclient.a -lz -lm -lcrypt ifneq (,$(shell grep FreeBSD /COPYRIGHT 2>/dev/null)) # FreeBSD LDFLAGS += -pthread else # Assume Linux LDLIBS += -lpthread endif # This works for simple one-file test programs sources := $(wildcard *.c) objects := $(patsubst %c,%o,$(sources)) targets := $(basename $(sources)) all: $(targets) clean: rm -f $(targets) $(objects) *.core