| 1 |
# Makefile for programs illustrating dynamic loading of C functions from Icon |
| 2 |
# |
| 3 |
# It is assumed that the standard C functions will be found by iconx. |
| 4 |
.POSIX: |
| 5 |
|
| 6 |
include ../../../Makedefs |
| 7 |
CFLAGS = -O $(CFDYN) -I../../cfuncs |
| 8 |
|
| 9 |
ICONT = icont |
| 10 |
IFLAGS = -us |
| 11 |
|
| 12 |
.SUFFIXES: .icn |
| 13 |
.icn: ; $(ICONT) $(IFLAGS) $< |
| 14 |
|
| 15 |
MKLIB = ../../cfuncs/mklib.sh |
| 16 |
|
| 17 |
|
| 18 |
PROGS = btest ddtest dldemo cspace tnet newsgrp |
| 19 |
FUNCS = argdump.o cspgen.o ddump.o |
| 20 |
FUNCLIB = libdemo.so |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
default: $(PROGS) $(FUNCLIB) |
| 25 |
|
| 26 |
$(PROGS): libnames.icn |
| 27 |
|
| 28 |
libnames.icn: Makefile |
| 29 |
echo '$$define FUNCLIB "./$(FUNCLIB)"' >libnames.icn |
| 30 |
|
| 31 |
$(FUNCLIB): $(FUNCS) |
| 32 |
CC="$(CC)" CFLAGS="$(CFLAGS)" BIN="../../../bin" \ |
| 33 |
sh $(MKLIB) $(FUNCLIB) $(FUNCS) |
| 34 |
|
| 35 |
|
| 36 |
# Copy progs to ../../iexe: |
| 37 |
# nothing done here because these executables require libraries |
| 38 |
# and don't stand alone |
| 39 |
Iexe: |
| 40 |
|
| 41 |
|
| 42 |
clean Clean: |
| 43 |
rm -f $(PROGS) $(FUNCLIB) *.o *.so *.u[12] libnames.icn |