August 21st, 2003, 10:37 AM
I would just like to know how this works:
how is it possible to compile a .c file (in this case loginsert.c) with the other logfilter_rule* files in the resulting binaries. What is the purpose if no reference to any of the functions has been made in the loginsert.c file (even though it appears the previous programmer has been able to make use of them). I grepped through the files and nowhere is there a reference to any of the functions in logfilter_rule_domain.c. I have the unenviable task of unravelling the previos programmers uncommented code and finishing his work off for him. That and I am fresh out of university with just a year of C++ behind me. I have a basic understanding of linux at the moment and the program that I am 'finishing off' is being run on FreeBSD. Any help would be greatly appreciated...
Here is the makefile:
LDFLAGS=-L/usr/local/lib -lpq -lm
all: logconvert loginsert
logconvert: logconvert.o logcut.o
loginsert: loginsert.o tokenizer.o logconf.o logfilter.o logutil.o logcut.o logcache.o $(FILTER_RULES)
cp logconvert loginsert /usr/local/bin
rm -f logconvert loginsert *.o
August 21st, 2003, 10:54 AM
There are a couple of things that might help you out. First, practice with written English a little more. Your message took some deciphering. Second, you'll want to read up on Makefiles a little bit. If you're working in FreeBSD you'll need to use them a lot.
The problem with your Makefile is that you don't have any instructions for the loginsert target, only a list of dependencies. In theory you want to link all of those object files together into an executable. That might be as simple a rule as $(CC) your dependencies here. I don't have enough information to go on based on what you've posted. That's why you should check out the man page on make. You might also want to hunt for articles on the web.
Articles and commentary on web development