diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..8852802 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,126 @@ +# +# Makefile.in/Makefile, build rules for pseudo +# +# Copyright (c) 2008-2010 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the Lesser GNU General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the Lesser GNU General Public License for more details. +# +# You should have received a copy of the Lesser GNU General Public License +# version 2.1 along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# configuration flags +PREFIX=@PREFIX@ +SUFFIX=@SUFFIX@ +SQLITE=@SQLITE@ +BITS=@BITS@ +MARK64=@MARK64@ +VERSION=0.2 + +LIBDIR=$(PREFIX)/lib$(MARK64) +BINDIR=$(PREFIX)/bin +DATADIR=$(PREFIX)/var/pseudo + +CFLAGS_BASE=-pipe -std=gnu99 -Wall +CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS) +CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"' +CFLAGS_DEBUG=-O2 -g +CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include +CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \ + $(CFLAGS_DEBUG) $(CFLAGS_SQL) + +GLOB_PATTERN=guts/*.c +GUTS=$(filter-out "$(GLOB_PATTERN)",$(wildcard $(GLOB_PATTERN))) + +DBLDFLAGS=-lsqlite3 +USE_64=wrapfuncs64.in + +SHOBJS=pseudo_table.o pseudo_util.o +DBOBJS=pseudo_db.o -ldl -lpthread +WRAPOBJS=pseudo_wrappers.o + +test: install + @echo "No tests yet." + +all: libpseudo.so pseudo pseudodb pseudolog + +install-lib: libpseudo.so + mkdir -p $(DESTDIR)$(LIBDIR) + cp libpseudo*.so $(DESTDIR)$(LIBDIR) + +install-bin: pseudo pseudodb pseudolog + mkdir -p $(DESTDIR)$(BINDIR) + cp pseudo pseudodb pseudolog $(DESTDIR)$(BINDIR) + +install-data: + mkdir -p $(DESTDIR)$(DATADIR) + +install: all install-lib install-bin install-data + +pseudo: pseudo.o $(SHOBJS) $(DBOBJS) pseudo_server.o pseudo_ipc.o + $(CC) $(CFLAGS) -o pseudo \ + pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \ + $(DBOBJS) $(SHOBJS) $(DBLDFLAGS) + +pseudolog: pseudolog.o $(SHOBJS) $(DBOBJS) + $(CC) $(CFLAGS) -o pseudolog pseudolog.o \ + $(DBOBJS) $(SHOBJS) $(DBLDFLAGS) + +pseudodb: pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o + $(CC) $(CFLAGS) -o pseudodb pseudodb.o \ + $(DBOBJS) $(SHOBJS) $(DBLDFLAGS) pseudo_ipc.o + +libpseudo.so: $(WRAPOBJS) pseudo_client.o pseudo_ipc.o $(SHOBJS) + $(CC) $(CFLAGS) -shared -o libpseudo.so \ + pseudo_client.o pseudo_ipc.o \ + $(WRAPOBJS) $(SHOBJS) -ldl + if test -n "$(SUFFIX)"; then \ + cp libpseudo.so libpseudo$(SUFFIX).so ; \ + fi + +pseudo_client.o pseudo_server.o pseudo_ipc.o: pseudo_ipc.h + +pseudo_client.o: pseudo_client.h + +pseudo_server.o: pseudo_server.h + +pseudo_wrappers.o: $(GUTS) + +wrappers: wrapfuncs.in $(USE_64) + ./makewrappers wrapfuncs.in $(USE_64) + +.SECONDARY: wrappers + +pseudo_wrappers.c: wrappers + +# no-strict-aliasing is needed for the function pointer trickery. +pseudo_wrappers.o: pseudo_wrappers.c + $(CC) -fno-strict-aliasing $(CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c + +offsets32: + $(CC) -m32 -o offsets32 offsets.c + +offsets64: + $(CC) -m64 -o offsets64 offsets.c + +clean: + rm -f *.o *.so pseudo pseudodb pseudolog \ + pseudo_wrappers.h pseudo_wrappers.c \ + pseudo_wrapper_table.c pseudo_wrappers.c.old \ + pseudo_wrappers.h.old offsets32 offsets64 + +distclean: clean + rm -f Makefile + @echo "WARNING: Makefile has been removed. You must reconfigure to do anything else." + +nuke: distclean + case "$(PREFIX)" in "`pwd`"/*) rm -rf "$(PREFIX)";; esac + @echo "WARNING: Removed $(PREFIX)." |