using suffixes in Makefile, moved changed files from src to common (merged)

This commit is contained in:
Glen Wiley 2013-07-15 18:20:25 -04:00
parent bd186ebca0
commit 18d58a5892
5 changed files with 14 additions and 10 deletions

View File

@ -15,17 +15,19 @@ srcdir = .
CC=gcc
CFLAGS=-g -I$(srcdir)/ -std=c99
CFLAGS=-Wall -g -fPIC -I$(srcdir)/ -std=c99
LDFLAGS=-L.
LDLIBS=-levent_core -lldns -lgetdns
PROGRAMS=example-simple-answers example-tree example-all-functions example-synchronous
.SUFFIXES: .c .o .a .lo .h
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
all: libgetdns example-simple-answers example-tree example-all-functions example-synchronous
getdns_core_only.o: getdns_core_only.c
$(CC) -c -Wall -fPIC $(CFLAGS) $^
libgetdns: getdns_core_only.c
libgetdns: getdns_core_only.o getdns_sync.o getdns_context.o
$(CC) $(CFLAGS) -shared -o libgetdns.so $^
clean:

View File

@ -15,17 +15,19 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC=gcc
CFLAGS=-g -I$(srcdir)/ -std=c99
CFLAGS=-Wall -g -fPIC -I$(srcdir)/ -std=c99
LDFLAGS=-L.
LDLIBS=-levent_core -lldns -lgetdns
PROGRAMS=example-simple-answers example-tree example-all-functions example-synchronous
.SUFFIXES: .c .o .a .lo .h
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
all: libgetdns example-simple-answers example-tree example-all-functions example-synchronous
getdns_core_only.o: getdns_core_only.c
$(CC) -c -Wall -fPIC $(CFLAGS) $^
libgetdns: getdns_core_only.c
libgetdns: getdns_core_only.o getdns_sync.o getdns_context.o
$(CC) $(CFLAGS) -shared -o libgetdns.so $^
clean: