mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
49b89633f1
Add shared-build target to libreplace. Useful to build multiple standalone libraries that depend on each other without having to install them to the final install dir during the build.
71 lines
1.5 KiB
Makefile
71 lines
1.5 KiB
Makefile
#!gmake
|
|
#
|
|
CC = @CC@
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
bindir = @bindir@
|
|
includedir = @includedir@
|
|
libdir = @libdir@
|
|
VPATH = @libreplacedir@
|
|
srcdir = @srcdir@
|
|
builddir = @builddir@
|
|
sharedbuilddir = @sharedbuilddir@
|
|
INSTALLCMD = @INSTALL@
|
|
LIBS = @LIBS@
|
|
|
|
.PHONY: test all showflags install installcheck clean distclean realdistclean
|
|
|
|
CFLAGS=-I. @CFLAGS@
|
|
LDFLAGS=@LDFLAGS@
|
|
|
|
OBJS = @LIBREPLACEOBJ@
|
|
|
|
all: showflags libreplace.a testsuite
|
|
|
|
showflags:
|
|
@echo 'libreplace will be compiled with flags:'
|
|
@echo ' CC = $(CC)'
|
|
@echo ' CFLAGS = $(CFLAGS)'
|
|
@echo ' LDFLAGS= $(LDFLAGS)'
|
|
@echo ' LIBS = $(LIBS)'
|
|
|
|
install: all
|
|
${INSTALLCMD} -d $(libdir)
|
|
${INSTALLCMD} -m 644 libreplace.a $(libdir)
|
|
|
|
shared-build: all
|
|
${INSTALLCMD} -d $(sharedbuilddir)/include
|
|
${INSTALLCMD} -m 644 replace.h $(sharedbuilddir)/include
|
|
${INSTALLCMD} -d $(sharedbuilddir)/lib
|
|
${INSTALLCMD} -m 644 libreplace.a $(sharedbuilddir)/lib
|
|
|
|
libreplace.a: $(OBJS)
|
|
ar -rcsv $@ $(OBJS)
|
|
|
|
test: all
|
|
./testsuite
|
|
|
|
installcheck: install test
|
|
|
|
TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
|
|
|
|
testsuite: libreplace.a $(TEST_OBJS)
|
|
$(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS)
|
|
|
|
.c.o:
|
|
@echo Compiling $*.c
|
|
@mkdir -p `dirname $@`
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
clean:
|
|
rm -f *.o test/*.o *.a testsuite
|
|
rm -f testfile.dat
|
|
|
|
distclean: clean
|
|
rm -f *~ */*~
|
|
rm -f config.log config.status config.h config.cache
|
|
rm -f Makefile
|
|
|
|
realdistclean: distclean
|
|
rm -f configure config.h.in
|