From e047ec28ef55bc5a2bb8b1790201e51d02eb5a12 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 6 Jun 2017 13:55:17 +0200 Subject: Remove a much of stuff, change license, and add support for float and long double MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..acfc5b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +.POSIX: + +include config.mk + +OBJ =\ + float.o\ + double.o\ + long-double.o + +HDR =\ + libcolour.h + +TEMPLATES =\ + convert-template.c\ + libcolour-template.c + + +all: libcolour.a libcolour.so.$(VERSION_MAJOR).$(VERSION_MINOR) test + + +float.o: float.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ float.c + +double.o: double.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ double.c + +long-double.o: long-double.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ long-double.c + + +float.pic.o: float.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ float.c + +double.pic.o: double.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ double.c + +long-double.pic.o: long-double.c $(TEMPLATES) $(HDR) + $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ long-double.c + + +libcolour.a: $(OBJ) + $(AR) rc $@ $? + $(AR) -s $@ + +libcolour.so.$(VERSION_MAJOR).$(VERSION_MINOR): $(OBJ:.o=.pic.o) + $(CC) -shared -Wl,-soname,libcolour.so.$(VERSION_MAJOR) -o $@ $(LDFLAGS) $^ + + +test.o: test.c libcolour.h + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ test.c + +test: test.o libcolour.a + $(CC) -o $@ $^ $(LDFLAGS) + + +check: test + ./test + +clean: + -rm -- *.o *.a *.so *.so.* test + +.PHONY: all clean check -- cgit v1.2.3-70-g09d2