about summary refs log tree commit diff
path: root/lib/util/Makefile
blob: 8b3fa1c14b918c9dbd457e16a0d23e6919819aff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ifeq ($(SRCDIR)x,x)
  SRCDIR = $(CURDIR)/../..
  BUILDDIR = $(SRCDIR)
endif
SUBDIR = lib/util
VPATH=.:$(SRCDIR)/$(SUBDIR)

include $(BUILDDIR)/config.mk

# nstring is required for asprintf(), etc.  Also some systems don't have
# snprintf(), e.g. Solaris 2.5.1.  2002.03.29.
UTILOBJECTS = shhopt.o nstring.o vasprintf.o filename.o nsleep.o

MERGE_OBJECTS =

all: $(UTILOBJECTS)

include $(SRCDIR)/common.mk

INCLUDES = -I$(SRCDIR)/$(SUBDIR) -I. -Iimportinc

$(UTILOBJECTS):%.o:%.c importinc
	$(CC) -c $(INCLUDES) -DNDEBUG $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SHLIB) \
	  $(CFLAGS_PERSONAL) $(CADD) -o $@ $<

testnstring: test.c nstring.h nstring.o
	$(CC) $(CFLAGS) $(CADD) -o $@ nstring.o $<