# LC_make:
# Sample makefile for Iron Spring PL/I [Linux]
# This makefile will compile a PL/I program
# and link it with libc.
# It assumes the compiler has been installed in
# a directory in your $PATH, and that
# the library is in /usr/local/lib.
# It also assumes that gcc is installed on your system.

# The ld flag '-z muldefs' is required to prevent
# link errors caused by possible multiple definitions
# of initialized PL/I EXTERNAL data.

# When linked without libc, the entry point should be
# 'main' or '_pli_Main', defined by the ld option '-e main'.

# 'INC' provides a list of directories to search for include files.
# Each entry should be preceded by '-i'
# 'LIBDIR' is the directory to be searched for the runtlime library.

# Programs compiled and/or linked using this makefile will use separate
# heaps for PL/I and C allocated storage.

PLI	= plic
PLIFLGS	= -lixg -ew
INC     = -i.
#LIBDIR	= /

%.o:	%.pli 
	${PLI} -C ${PLIFLGS}  $^ -o $*.o
	
%:	%.o
	gcc -o $@ $^ -lprf -Wl,-M -Wl,-zmuldefs >$@.map

