R
Rudra Banerjee
Dear friends,
my project has structure like
$ls new
files Makefile help.c table.c callbk_list.h cwlst.h
where files is a directory, with hundreds of C code, which are the functions in the main code table.c
I tried to compile with Makefile as:
CC=gcc
CFLAGS =-O3
SUBDIR=files
PCONF1=pkg-config --cflags --libs gtk+-2.0
objects := $(wildcard $(SUBDIR)/*.o)
ptbl: $(objects) help.c table.c callbk_list.h cwlst.h
$(CC) `$(PCONF1)` $(objects) help.c table.c -o ptbl
$(SUBDIR)/%.o: $(SUBDIR)/%.c
$(CC) -c `$(PCONF1)` $<
which is not compiling the $(SUBDIR)/%.c files at all, with make giving error:
$ make
gcc `pkg-config --cflags --libs gtk+-2.0` help.c table.c -o ptbl
/tmp/ccOKcWuf.o: In function `main':
table.c
.text+0xa9a): undefined reference to `callback_A'
table.c
.text+0xb3a): undefined reference to `callback_B'
.....
and so on
but if I try to compile directly,
gcc -g table.c help.c files/prop_*.c `pkg-config --cflags --libs ^Ck+-2.0` -o ptbl
its working fine.
Can anybody please show me the error?
my project has structure like
$ls new
files Makefile help.c table.c callbk_list.h cwlst.h
where files is a directory, with hundreds of C code, which are the functions in the main code table.c
I tried to compile with Makefile as:
CC=gcc
CFLAGS =-O3
SUBDIR=files
PCONF1=pkg-config --cflags --libs gtk+-2.0
objects := $(wildcard $(SUBDIR)/*.o)
ptbl: $(objects) help.c table.c callbk_list.h cwlst.h
$(CC) `$(PCONF1)` $(objects) help.c table.c -o ptbl
$(SUBDIR)/%.o: $(SUBDIR)/%.c
$(CC) -c `$(PCONF1)` $<
which is not compiling the $(SUBDIR)/%.c files at all, with make giving error:
$ make
gcc `pkg-config --cflags --libs gtk+-2.0` help.c table.c -o ptbl
/tmp/ccOKcWuf.o: In function `main':
table.c
table.c
.....
and so on
but if I try to compile directly,
gcc -g table.c help.c files/prop_*.c `pkg-config --cflags --libs ^Ck+-2.0` -o ptbl
its working fine.
Can anybody please show me the error?