put /local/pcb/CFLAGS_HIDLIB_STATIC_ {}
append /local/pcb/CFLAGS_HIDLIB_STATIC_ ?/local/pcb/CFLAGS_HIDLIB_STATIC
put /local/pcb/LDFLAGS_HIDLIB_STATIC_ {}
append /local/pcb/LDFLAGS_HIDLIB_STATIC_ ?/local/pcb/LDFLAGS_HIDLIB_STATIC

append /local/pcb/LDFLAGS_HIDLIB_STATIC_ [@ -lm @?/target/libs/ldl@ @]
if ?libs/script/fungw/presents
then
# system installed fungw
	append /local/pcb/CFLAGS_HIDLIB_STATIC_ libs/script/fungw/cflags
	append /local/pcb/LDFLAGS_HIDLIB_STATIC_ libs/script/fungw/ldflags
end

uniq /local/pcb/CFLAGS_HIDLIB_STATIC_
uniq /local/pcb/LDFLAGS_HIDLIB_STATIC_

gsub /local/pcb/CFLAGS_HIDLIB_STATIC_ {[.][.]/src_3rd/} {$(LIBRND_ROOT)/src_3rd/}

# Lesstif requires that -lXm is before -lXt or else there is a runtime BadWindow error
order /local/pcb/LDFLAGS_HIDLIB_STATIC_ {-lXm} {before} {-lXt}

print [@

#
# Auto-generated Makefile for inclusion for librnd users.
#
# The user's Makefile needs to, in this order:
#  - set up $(LIBRND_ROOT)
#  - include this file
#  - use the variables declared in this file for compilation and linking
#

CFLAGS_LIBRND=@?/local/pcb/CFLAGS_HIDLIB_STATIC_@ -I$(LIBRND_ROOT)/include -I$(LIBRND_ROOT)/include/librnd/src_3rd
LDFLAGS_LIBRND=@?/local/pcb/LDFLAGS_HIDLIB_STATIC_@
PUPLUG=$(LIBRND_ROOT)/lib/librnd/puplug

# These are extracts of the fungw-specific parts; only needed if the the above
# are NOT used (partial linking)
@]
if ?libs/script/fungw/presents
then
print [@
CFLAGS_LIBRND_FUNGW=@libs/script/fungw/cflags@
LDFLAGS_LIBRND_FUNGW=@libs/script/fungw/ldflags@
@]
else
print [@
CFLAGS_LIBRND_FUNGW=
LDFLAGS_LIBRND_FUNGW=
@]
end


print [@
LIBRND_EXE=@/target/sys/ext_exe@
@]
