use Makefile.inc to determine sources.

pull/1/head
Gunter Knauf 18 years ago
parent 72beefe4f4
commit 1d987360cb
  1. 44
      Makefile.m32

@ -5,27 +5,30 @@
## Use: make -f Makefile.m32 [demos] ## Use: make -f Makefile.m32 [demos]
## ##
## Quick hack by Guenter; comments to: /dev/nul ## Quick hack by Guenter; comments to: /dev/nul
#
########################################################
## Nothing more to do below this line!
LIB = libcares.a
CC = gcc CC = gcc
LD = gcc
RANLIB = ranlib RANLIB = ranlib
#RM = rm -f
######################################################## CFLAGS = -O2 -Wall
## Nothing more to do below this line! LDFLAGS = -s
LIBS = -lwsock32
LIB=libcares.a # Makefile.inc provides the CSOURCES and HHEADERS defines
CC=gcc include Makefile.inc
CFLAGS=-O2 -Wall
LDFLAGS=-s
LIBS=-lwsock32
MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3)) OBJLIB := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
OBJS := $(patsubst %.c,%.o,$(wildcard ares_*.c))
OBJS += windows_port.o inet_ntop.o inet_net_pton.o bitncmp.o
$(LIB): ${OBJS} $(LIB): $(OBJLIB)
ar cru $@ ${OBJS} ar cru $@ $^
${RANLIB} $@ $(RANLIB) $@
all: $(LIB) demos all: $(LIB) demos
@ -34,16 +37,13 @@ demos: adig.exe ahost.exe
tags: tags:
etags *.[ch] etags *.[ch]
adig.exe: adig.o $(LIB) %.exe: %.o ares_getopt.o $(LIB)
${CC} ${LDFLAGS} -o $@ adig.o $(LIB) ${LIBS} $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
ahost.exe: ahost.o $(LIB)
${CC} ${LDFLAGS} -o $@ ahost.o $(LIB) ${LIBS}
${OBJS}: ares.h ares_dns.h ares_private.h $(OBJLIB): ares.h ares_dns.h ares_private.h
.c.o: .c.o:
${CC} -c ${CFLAGS} $< $(CC) $(CFLAGS) -c $<
check: check:
@ -61,8 +61,8 @@ install:
done) done)
clean: clean:
rm -f ${OBJS} $(LIB) adig.o adig.exe ahost.o ahost.exe $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe
distclean: clean distclean: clean
rm -f config.cache config.log config.status Makefile $(RM) config.cache config.log config.status Makefile

Loading…
Cancel
Save