[NBLUG/talk] GNU Makefile

Zack Gold zg at nblug.org
Sat Sep 6 07:56:11 PDT 2014


You could first try running gmakemake (a utility that will build the
Makefile for you) and then modifying the output as necessary.

$ gmakemake > Makefile
On Sep 6, 2014 9:17 AM, "Omar Eljumaily" <omar at omnicode.com> wrote:

> 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.
>
> Thanks,
>
> Omar
>
> EXENAME = omilter
> LDFLAGS = -lmilter -lresolv -L/usr/lib/libmilter/
> INCLUDES = -I../DBLeaper
> CPP = g++
> INCFLAGS =
> CPPFLAGS =
> CFLAGS += -pipe -Wall -pedantic -O2 -fstack-protector-all -D_REENTRANT
> DEBUGCFLAGS = -pipe -Wall -pedantic -Werror -ggdb
> -Wno-error=unused-variable -fstack-protector-all
> LIBS = ../DBLeaper/lib/libDBLeaper.a -lstdc++ -ldl
>
> objs=\
> mbq.o m1.o\
>
> all: $(objs)
>     $(CPP) $(CFLAGS) $(LDFLAGS) $(LIBS) $(objs)  -o $(EXENAME)
>
> %.o : %.cpp
>     $(CPP) $(CPPFLAGS) $(INCLUDES) -c $<
>
> %.o: %.c
>     $(CC) $(CFLAGS) $(INCFLAGS) $< -c -o $@
>
> debug:
>     $(CC) $(DEBUGCFLAGS) $(INCFLAGS) $(LDFLAGS) *.c  -o $(EXENAME)-debug
>
> clean:
>     rm -f $(EXENAME) $(EXENAME)-debug $(objs) $(OBJECTS)
>
>
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nblug.org/pipermail/talk/attachments/20140906/90e41796/attachment.html>


More information about the talk mailing list