<p dir="ltr">You could first try running gmakemake (a utility that will build the Makefile for you) and then modifying the output as necessary.</p>
<p dir="ltr">$ gmakemake > Makefile</p>
<div class="gmail_quote">On Sep 6, 2014 9:17 AM, "Omar Eljumaily" <<a href="mailto:omar@omnicode.com">omar@omnicode.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does anybody know about GNU Makfiles?  I'm trying to make a Milter that checks for recently listed domains, from which I'm getting a lot of spam.  If I link using a command line, it links fine, but if I use a Makefile it doesn't recognize the objects in libDBLeaper.a. I'm guessing it has something to do with mixing c & c++ code, where it does some sort of name mangling and doesn't recognize the original form.<br>
<br>
Thanks,<br>
<br>
Omar<br>
<br>
EXENAME = omilter<br>
LDFLAGS = -lmilter -lresolv -L/usr/lib/libmilter/<br>
INCLUDES = -I../DBLeaper<br>
CPP = g++<br>
INCFLAGS =<br>
CPPFLAGS =<br>
CFLAGS += -pipe -Wall -pedantic -O2 -fstack-protector-all -D_REENTRANT<br>
DEBUGCFLAGS = -pipe -Wall -pedantic -Werror -ggdb -Wno-error=unused-variable -fstack-protector-all<br>
LIBS = ../DBLeaper/lib/libDBLeaper.a -lstdc++ -ldl<br>
<br>
objs=\<br>
mbq.o m1.o\<br>
<br>
all: $(objs)<br>
    $(CPP) $(CFLAGS) $(LDFLAGS) $(LIBS) $(objs)  -o $(EXENAME)<br>
<br>
%.o : %.cpp<br>
    $(CPP) $(CPPFLAGS) $(INCLUDES) -c $<<br>
<br>
%.o: %.c<br>
    $(CC) $(CFLAGS) $(INCFLAGS) $< -c -o $@<br>
<br>
debug:<br>
    $(CC) $(DEBUGCFLAGS) $(INCFLAGS) $(LDFLAGS) *.c  -o $(EXENAME)-debug<br>
<br>
clean:<br>
    rm -f $(EXENAME) $(EXENAME)-debug $(objs) $(OBJECTS)<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
talk mailing list<br>
<a href="mailto:talk@nblug.org" target="_blank">talk@nblug.org</a><br>
<a href="http://nblug.org/cgi-bin/mailman/listinfo/talk" target="_blank">http://nblug.org/cgi-bin/<u></u>mailman/listinfo/talk</a><br>
</blockquote></div>