summaryrefslogtreecommitdiffstats
path: root/freebsd-userspace/Makefile
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-09-12 17:09:48 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-09-12 17:11:16 -0500
commitc52d92245af983204feadd0248c0fc668765e73d (patch)
tree1ca9284e7d4e0c5b75349e1cdccea2ee2612a2e9 /freebsd-userspace/Makefile
parentAdded __res_state to user space. (diff)
downloadrtems-libbsd-c52d92245af983204feadd0248c0fc668765e73d.tar.bz2
nsdispatch.c: New file added along with required dependencies
This file uses dynamic loading and is using some magic for statically linked modules included in it. These modules may or may not show up magically in an RTEMS executable. This will eventually have to be investigated and resolved.
Diffstat (limited to 'freebsd-userspace/Makefile')
-rw-r--r--freebsd-userspace/Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/freebsd-userspace/Makefile b/freebsd-userspace/Makefile
index 7055f0ad..b06cffe2 100644
--- a/freebsd-userspace/Makefile
+++ b/freebsd-userspace/Makefile
@@ -13,6 +13,8 @@ CFLAGS += -Isys
CFLAGS += -Ilocal
# XXX hack to find rpc
CFLAGS += -I../services/librpc/include
+# nsparser needs this
+CFLAGS += -Ilib/libc/net
CFLAGS += -I$(INSTALL_BASE)/include
@@ -57,6 +59,8 @@ C_FILES += lib/libc/net/getproto.c
C_FILES += lib/libc/net/getprotoent.c
C_FILES += lib/libc/net/getprotoname.c
C_FILES += lib/libc/net/getservent.c
+C_FILES += lib/libc/net/nsdispatch.c
+C_FILES += lib/libc/net/nslexer.c
C_FILES += lib/libc/gen/err.c
C_FILES += lib/libc/gen/gethostname.c
C_FILES += lib/libc/nameser/ns_name.c
@@ -204,6 +208,11 @@ C_D_FILES = $(C_FILES:%.c=%.d)
LIB = libbsdc.a
GEN_FILES = include/rpc/rpcb_prot.h
GEN_FILES += commands/sbin/route/keywords.h
+GEN_FILES += lib/libc/net/nslexer.c
+GEN_FILES += lib/libc/net/nsparser.c
+
+EXTRA_CLEAN = lib/libc/net/nsparser.i
+
all: $(LIB)
$(LIB): $(GEN_FILES) $(C_O_FILES)
@@ -223,6 +232,17 @@ commands/sbin/route/keywords.h: commands/sbin/route/keywords
> commands/sbin/route/keywords.h
rm -f _keywords.tmp
+YFLAGS+=-p_nsyy
+LFLAGS+=-P_nsyy
+
+lib/libc/net/nslexer.c: lib/libc/net/nslexer.l
+ ${LEX} ${LFLAGS} -t $^ | \
+ sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
+
+lib/libc/net/nsparser.c: lib/libc/net/nsparser.y
+ yacc -d ${YFLAGS} -o lib/libc/net/nsparser.i $^
+ cat lib/libc/net/nsparser.i | \
+ sed -e '/YY_BUF_SIZE/s/16384/1024/' >$@
install: $(LIB)
install -d $(INSTALL_BASE)/include
cd include; for i in `find . -name '*.h'` ; do \
@@ -236,7 +256,7 @@ install: $(LIB)
install -c -m 644 $(LIB) $(INSTALL_BASE)
clean:
- rm -f $(LIB) $(C_O_FILES) $(C_D_FILES) $(GEN_FILES)
+ rm -f $(LIB) $(C_O_FILES) $(C_D_FILES) $(GEN_FILES) $(CLEAN_FILES)
-include $(C_D_FILES)