Find the answer to your Linux question:
Results 1 to 2 of 2
Hi every body, iam having make file like this , XTRAOBJS = LDFLAGS = LINTFLAGS = -a -b -h PIC = _pic CFLAGS = -g $(INCFLAGS) $(XTRACFLAG) -DNO_ACTIVATION_SUPPORT CFLAGS_PIC = ...
  1. #1
    Linux Newbie
    Join Date
    Oct 2006
    Posts
    107

    word replacing in makefile using script file

    Hi every body,

    iam having make file like this ,


    XTRAOBJS =
    LDFLAGS =
    LINTFLAGS = -a -b -h
    PIC = _pic
    CFLAGS = -g $(INCFLAGS) $(XTRACFLAG) -DNO_ACTIVATION_SUPPORT
    CFLAGS_PIC = -fPIC -DIS_PIC
    SRCS = $(SRCDIR)/lsvendor.c
    STRIP = strip
    OBJS = lmcrypt.o \
    lmstrip.o \
    lsvendor.o
    ACTSTUB = ./activation/lib/libnoact.a
    LD=$(CC)
    DAEMON = demoEXECS = lmcrypt lmflex
    CLIENTLIB = liblmgr.a libcrvs.a libsb.a $(BORROWOBJ)
    LIBS = liblmgr_as.a liblmgr_s.a $(CLIENTLIB)
    LINTLIB = llib-llmgr.a.ln
    UTILS = lmhostid lmdown lminstall lmremove \
    lmreread lmswitchr lmstat lmdiag lmver lmpath lmborrow lmswitch
    all: $(EXECS) $(DAEMON) utils
    lmnewgen: $(MAINSRCDIR)/machind/lsvendor.c $(MAINSRCDIR)/machind/lm_code.h
    ./lmrand1 -i $(SRCDIR)/lsvendor.c
    $(CC) -c $(CFLAGS) lmcode.c
    $(CC) $(CFLAGS) $(LDFLAGS) lmnewgen.o lmcode.o $(CLIENTLIB) $(ACTSTUB) $(XTRALIB) $(THREADLIB) \
    -o lmnewgen
    daemon: $(DAEMON)

    which i need to modify the bolded name demo with different names....

    Using scripting how can i do....

    pls help me out...
    Thanks in Advance

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    well, I'd say "sed" is the one: suppose
    you want "nemo" instead of "demo": then

    sed 's/demo/nemo/' <Makefile >Makefile.new

    should do it.
    the sun is new every day (heraclitus)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...