From a27311a1e468ec0ea8205cc362dc69386675f704 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 8 Nov 2021 20:42:43 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5390abd --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OS = linux +# Linux: linux +# Mac OS: macos +# Windows: windows +include mk/$(OS).mk + + +LIB_MAJOR = 1 +LIB_MINOR = 0 +LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR) +LIB_NAME = tracebitmap + + +OBJ =\ + libtracebitmap_trace.o + +HDR =\ + libtracebitmap.h + +LOBJ = $(OBJ:.o=.lo) + + +all: libtracebitmap.a libtracebitmap.$(LIBEXT) demo +$(OBJ): $(HDR) +$(LOBJ): $(HDR) + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.c.lo: + $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +demo: demo.o libtracebitmap.a + $(CC) -o $@ demo.o libtracebitmap.a $(CFLAGS) $(CPPFLAGS) + +libtracebitmap.a: $(OBJ) + @rm -f -- $@ + $(AR) rc $@ $(OBJ) + +libtracebitmap.$(LIBEXT): $(LOBJ) + $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) + +install: libtracebitmap.a libtracebitmap.$(LIBEXT) + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libtracebitmap.a "$(DESTDIR)$(PREFIX)/lib/" + cp -- libtracebitmap.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBMINOREXT)" + ln -sf -- libtracebitmap.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBMAJOREXT)" + ln -sf -- libtracebitmap.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBEXT)" + cp -- libtracebitmap.h "$(DESTDIR)$(PREFIX)/include/" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBMAJOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBMINOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtracebitmap.$(LIBEXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libtracebitmap.h" + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) demo + +.SUFFIXES: +.SUFFIXES: .lo .o .c + +.PHONY: all install uninstall clean -- cgit v1.2.3-70-g09d2