diff options
author | Josh Triplett <josh@freedesktop.org> | 2006-12-05 01:44:03 -0800 |
---|---|---|
committer | Josh Triplett <josh@freedesktop.org> | 2006-12-05 01:48:33 -0800 |
commit | 01bd4dbe25c545234e19cb5e6453cf96a98b9f99 (patch) | |
tree | d21b6433d41cc8dbd99f7858fe96e1d168d2f840 /Makefile | |
parent | ab5399000739d32922338f7325a29075eea5e934 (diff) | |
download | sparse-01bd4dbe25c545234e19cb5e6453cf96a98b9f99.tar.gz |
Install static library and header files
Modify Makefile to install the static library and all of the library header
files. Add dissect.h to LIB_H. Remove redundant headers from dependency
lines. Remove rpath suggestion.
The header files get installed to a "sparse" subdirectory of the include
directory; please reference the sparse headers as sparse/${HEADER}.h. The
various sparse test programs can all now compile successfully outside the
sparse tree, given that modification to their #include lines.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 17 insertions, 20 deletions
@@ -13,20 +13,17 @@ AR=ar # CFLAGS += -DDEBUG -# -# If building with shared libraries, you might -# want to add this -# -# LDFLAGS += -Wl,-rpath,$(BINDIR) - PREFIX=$(HOME) BINDIR=$(PREFIX)/bin +LIBDIR=$(PREFIX)/lib +INCLUDEDIR=$(PREFIX)/include/sparse + PROGRAMS=test-lexing test-parsing obfuscate compile graph sparse test-linearize example test-unssa test-dissect INST_PROGRAMS=sparse cgcc LIB_H= token.h parse.h lib.h symbol.h scope.h expression.h target.h \ linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \ - storage.h ptrlist.h + storage.h ptrlist.h dissect.h LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \ expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \ @@ -40,19 +37,19 @@ LIBS=$(LIB_FILE) all: $(PROGRAMS) -install: $(INST_PROGRAMS) bin-dir +install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) + install -d $(BINDIR) + install -d $(LIBDIR) + install -d $(INCLUDEDIR) for f in $(INST_PROGRAMS); do \ install -v $$f $(BINDIR)/$$f || exit 1; \ done - -bin-dir: - @if ! test -d $(BINDIR); then \ - echo "No '$(BINDIR)' directory to install in"; \ - echo "Please create it and add it to your PATH"; \ - exit 1; \ - fi - -.PHONY: bin-dir + for f in $(LIBS); do \ + install -m 644 -v $$f $(LIBDIR)/$$f || exit 1; \ + done + for f in $(LIB_H); do \ + install -m 644 -v $$f $(INCLUDEDIR)/$$f || exit 1; \ + done test-lexing: test-lexing.o $(LIBS) $(CC) $(LDFLAGS) -o $@ $< $(LIBS) @@ -115,15 +112,15 @@ target.o: $(LIB_H) test-lexing.o: $(LIB_H) test-parsing.o: $(LIB_H) test-linearize.o: $(LIB_H) -test-dissect.o: $(LIB_H) dissect.h +test-dissect.o: $(LIB_H) compile.o: $(LIB_H) compile.h compile-i386.o: $(LIB_H) compile.h tokenize.o: $(LIB_H) sparse.o: $(LIB_H) obfuscate.o: $(LIB_H) example.o: $(LIB_H) -storage.o: $(LIB_H) storage.h -dissect.o: $(LIB_H) dissect.h +storage.o: $(LIB_H) +dissect.o: $(LIB_H) graph.o: $(LIB_H) compat-linux.o: compat/strtold.c compat/mmap-blob.c \ |