File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / bird / tools / Rules.in
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Aug 22 12:33:54 2017 UTC (6 years, 10 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

    1: # Makefile fragments for the BIRD Internet Routing Daemon
    2: # (c) 1999--2000 Martin Mares <mj@ucw.cz>
    3: 
    4: srcdir=@srcdir_rel_mf@
    5: srcdir_abs := $(shell cd $(srcdir) ; pwd)
    6: objdir=@objdir@
    7: exedir=@exedir@
    8: 
    9: protocols=@protocols@
   10: static-dirs := nest filter $(addprefix proto/,$(protocols))
   11: static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
   12: dynamic-dirs := lib conf
   13: dynamic-dir-paths := $(dynamic-dirs)
   14: client-dirs := client
   15: client-dir-paths := $(client-dirs)
   16: doc-dirs := doc
   17: doc-dir-paths := $(doc-dirs)
   18: 
   19: all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs) $(doc-dirs)
   20: clean-dirs:=$(all-dirs) proto sysdep
   21: 
   22: CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
   23: CFLAGS=$(CPPFLAGS) @CFLAGS@
   24: LDFLAGS=@LDFLAGS@
   25: LIBS=@LIBS@
   26: CLIENT_LIBS=@CLIENT_LIBS@
   27: CC=@CC@
   28: M4=@M4@
   29: BISON=@BISON@
   30: FLEX=@FLEX@
   31: RANLIB=@RANLIB@
   32: INSTALL=@INSTALL@
   33: INSTALL_PROGRAM=@INSTALL_PROGRAM@
   34: INSTALL_DATA=@INSTALL_DATA@
   35: 
   36: prefix=@prefix@
   37: exec_prefix=@exec_prefix@
   38: bindir=@bindir@
   39: sbindir=@sbindir@
   40: sysconfdir=@sysconfdir@
   41: localstatedir=@localstatedir@
   42: docdir=@prefix@/doc
   43: 
   44: ifdef source
   45: 
   46: objs := $(subst .c,.o,$(source))
   47: 
   48: ifdef dir-name
   49: src-path := $(srcdir)/$(dir-name)/
   50: endif
   51: 
   52: all:
   53: 	cd $(root-rel) && make
   54: 
   55: ifdef lib-dest
   56: 
   57: subdir: $(lib-dest)
   58: 
   59: $(lib-dest): $(objs)
   60: 	rm -f $@
   61: 	ar rcs $@ $^
   62: 	$(RANLIB) $@
   63: 
   64: else
   65: 
   66: subdir: all.o
   67: 
   68: all.o: $(objs)
   69: #       $(LD) -r -o $@ $^
   70: #	Changed to $(CC) because $(LD) has problems with crosscompiling
   71: 	@echo LD -r -o $@ $^
   72: 	@$(CC) -nostdlib -r -o $@ $^
   73: 
   74: endif
   75: 
   76: %.o: $(src-path)%.c
   77: 	@echo CC -o $@ -c $<
   78: 	@$(CC) $(CFLAGS) -o $@ -c $<
   79: 
   80: ifndef source-dep
   81: source-dep := $(source)
   82: endif
   83: 
   84: depend:
   85: 	$(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) >depend
   86: 
   87: ifneq ($(wildcard depend),)
   88: include depend
   89: endif
   90: 
   91: endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>