| 1 |
# icondb -- Icon database interface contributed by Carl Sturtivant. |
| 2 |
|
| 3 |
# Requires GNU make, gcc, mysql utilities, and mysql development package. |
| 4 |
|
| 5 |
ifndef TARGET |
| 6 |
|
| 7 |
ifneq ($(strip $(shell g++ -v 2>&1 | grep "darwin")),) |
| 8 |
TARGET=mac |
| 9 |
else |
| 10 |
ifneq ($(strip $(shell g++ -v 2>&1 | grep "cygwin")),) |
| 11 |
TARGET=cygwin |
| 12 |
else |
| 13 |
TARGET=other |
| 14 |
endif |
| 15 |
endif |
| 16 |
|
| 17 |
endif #TARGET |
| 18 |
|
| 19 |
|
| 20 |
ICON_PATH=../../.. |
| 21 |
|
| 22 |
|
| 23 |
SHARED_mac = -bundle -undefined suppress |
| 24 |
SHARED_cygwin = -shared |
| 25 |
SHARED_other = -shared |
| 26 |
|
| 27 |
PIC_mac = -flat_namespace |
| 28 |
PIC_other = -fPIC |
| 29 |
|
| 30 |
EXTRA_cygwin = $(ICON_PATH)/bin/iload.a -Wl,--enable-auto-import |
| 31 |
EXTRA_other = -I./ |
| 32 |
|
| 33 |
|
| 34 |
default: |
| 35 |
icont -ucs icondb.icn |
| 36 |
cp icondb.u1 icondb.u2 $(ICON_PATH)/lib |
| 37 |
sh -c "gcc -I../../cfuncs $(SHARED_$(TARGET)) -o mysqldb.so $(PIC_$(TARGET)) `mysql_config --cflags` mysqldb.c `mysql_config --libs`" |
| 38 |
cp mysqldb.so $(ICON_PATH)/bin |
| 39 |
|
| 40 |
clean Clean: |
| 41 |
rm -f *.u? *.o *.so */*.o */*.u? */*.so |