Thread: What's wrong with this Makefile??

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    12

    What's wrong with this Makefile??

    Hi folks!

    ...well...direct to the problem or "vamos al grano"...

    I execute the command make but don't "make" anything...

    My project has a Pro*c file with his include

    sql_def.pc and sql_def.h

    and others files with his includes.

    Code:
    CC = cc
    PROC_OPT = userid=pecbsan/pecbsan@DEFT
    AR = ar
    PROGS = sql_def
    DPI = -DPREINIT=1
    
    CFLAGS =-g -I. -I${HOME_INC} -I$ORACLE_HOME/precomp/public -I$ORACLE_HOME/rdbms/public -I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/plsql/public -I$ORACLE_HOME/network/public
    
    LDFLAGS =-L$ORACLE_HOME/lib/ -lc -lclntsh $ORACLE_HOME/lib/scorept.o $ORACLE_HOME/lib/sscoreed.o $ORACLE_HOME/rdbms/lib/kpudfo.o -lsql10 $ORACLE_HOME/lib/nautab.o $ORACLE_HOME/lib/naeet.o $ORACLE_HOME/lib/naect.o $ORACLE_HOME/lib/naedhs.o -lmm -ldl -lm -lpthread -lnsl -lirc -ldl -lm -lconf_init -L. -L${HOME_LIB} -lpsdxgw -lxmlite_c -ltags -lv8tools
    
    $(PROGS).c : $(PROGS).pc $(PROGS).h
            proc $(PROC_OPT) $<
    
    $(PROGS).o : $(PROGS).c
            $(CC) -g -c -o $@ $< $(CFLAGS) $(DPI)
    
    $(PROGS) : $(PROGS).o serv_batch.o utilidades.o mensajeria.o
            $(CC) -g -o $(PROGS) $^ $(LDFLAGS) $(DPI)
    
    utilidades.o : utilidades.c utilidades.h
            $(CC) -g -o $@ $^
    
    mensajeria.o : mensajeria.c mensajeria.h
            $(CC) -g -o $@ $^
    
    serv_batch.o : serv_batch.c serv_batch.h
            $(CC) -g -o $@ $^
    Thanks for the help!

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    My guess is that it doesn't do anything, because the ${PROGS}.c target is already upto date, and that's the target you get if you don't specify something else.

    I usually put a "all" target at the very beginning, something like this:
    Code:
    all: ${PROGS}
    This would go just before the ${PROGS}.c target.

    Also:
    Code:
    utilidades.o : utilidades.c utilidades.h
            $(CC) -g -o $@ $^
    
    mensajeria.o : mensajeria.c mensajeria.h
            $(CC) -g -o $@ $^
    
    serv_batch.o : serv_batch.c serv_batch.h
            $(CC) -g -o $@ $^
    You probably want $< for the three recipies above.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. makefile help
    By the Wookie in forum C++ Programming
    Replies: 10
    Last Post: 10-12-2003, 07:31 PM
  2. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM
  3. help with makefile
    By metsman20 in forum Linux Programming
    Replies: 0
    Last Post: 04-20-2003, 01:38 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. makefile woes
    By Grifftt in forum C Programming
    Replies: 2
    Last Post: 12-06-2002, 04:43 PM