c - Target somehow doesn't get created -


i have target doesn't create it's immediate dependencies do. , there's not error message.

here makefile:

prefix?=/home/jenia/learn-c-the-hard-way cflags=-g -wall -i${prefix}/lib/include ldflags=-l${prefix}/lib install_dir=/home/jenia/learn-c-the-hard-way/apps  all: set-manipulation set-manipulation: main.o  install:     install -d $(install_dir)/set-manipulation     install set-manipulation $(install_dir)/set-manipulation  clean:     rm -f *.o     rm -f set-manipulation     rm -rf *.dsym 

i end main.o file not set-manipulation file name of program.

like in bigger program want create object files first , program. like

all: my-amazing-prog  my-amazing-prog: a.o b.o c.o d.o  ... 

and end files:

a.o,  b.o,  c.o,  d.o,  my-amazing-prog 

so don't understand why i'm having trouble in case create both object.o files , prgram depends on them.

p.s.

just in case, here directory structure:

  /home/jenia/learn-c-the-hard-way/lib:   drwxr-xr-x  2 jenia jenia 4096 nov  1 12:47 include   -rwxr-xr-x  1 jenia jenia 6804 nov  1 12:47 set_theory.a -- 50   -rwxr-xr-x  1 jenia jenia 9664 nov  1 12:47 set_theory.so -- 11     /home/jenia/learn-c-the-hard-way/lib/include:   -rw-r--r--  1 jenia jenia   85 nov  1 12:47 bag.h -- 3   -rw-r--r--  1 jenia jenia   64 nov  1 12:47 new.h -- 2   -rw-r--r--  1 jenia jenia   92 nov  1 12:47 object.h -- 3   -rw-r--r--  1 jenia jenia  318 nov  1 12:47 set.h -- 16 

you need rule telling make how create set-manipulation main.o. part:

set-manipulation: main.o 

only specifies dependency, no commands. use, e.g.

set-manipulation: main.o       $(cc) -o "$@" main.o 

i'm pretty sure if

my-amazing-prog: a.o b.o c.o d.o 

does create my-amazing-prog do have commands associated it. make has built-in rules create program prog single source file prog.c, maybe have seen working somewhere else?


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

http - Safari render HTML as received -