aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile62
-rw-r--r--Makefile.in87
2 files changed, 62 insertions, 87 deletions
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
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index 6620bf2..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2016 Mattias Andrée <maandree@kth.se>
-#
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved. This file is offered as-is,
-# without any warranty.
-
-
-### This file will be stored to Makefile once you have run ./configure. ###
-### See INSTALL for information on how to install this package. ###
-
-
-
-##### What is below this line is configurable, but is seldom useful. #####
-
-
-# Additional options for compiling info and HTML manuals.
-INFO_FLAGS =
-
-# Additional options for compiling DVI, PDF, and PostScript manuals.
-TEXINFO_FLAGS =
-
-# The name of the package as it should be installed.
-PKGNAME = libcolour
-
-
-
-##### Nothing interesting below this. #####
-
-
-# In case you want add some configurations. Primarily
-# intended for maintainers. Perhaps add GPG_KEY here.
-# Of course, you can declare everthing with ./configure,
-# but with this you are less likely to forget it.
--include .make-configurations
-
-
-# YOU, AS A USER, SHOULD NOT CHANGE THESE VARIABLES. {{
-# They specify how the reusable makefiles in mk/ shall behave.
-
-# Package information.
-_PROJECT = libcolour
-_VERSION = 1.0
-
-# Used by mk/lang-c.mk
-_C_STD = c99
-_H = libcolour
-_HEADER_DIRLEVELS = 1
-_LIB = libcolour
-_OBJ_libcolour = libcolour convert
-_SO_VERSION_libcolour = $(_VERSION)
-_SO_MAJOR_libcolour = $(shell echo $(_SO_VERSION_libcolour) | cut -d . -f 1)
-
-# Used by mk/texinfo.mk
-_TEXINFO_DIRLEVELS = 2
-_INFOPARTS = 0
-_HAVE_TEXINFO_MANUAL = yes
-_HTML_FILES = Free-Software-Needs-Free-Documentation.html GNU-Free-Documentation-License.html \
- GNU-General-Public-License.html index.html Overview.html Colour-Spaces.html \
- Illuminants.html Functions.html CIE-1960-UCS.html CIELAB.html CIELCh.html \
- CIELUV.html CIEUVW.html CIExyY.html CIEXYZ.html RGB.html sRGB.html YCgCo.html \
- YDbDr.html YIQ.html YPbPr.html YUV.html
-
-# Used by mk/man.mk
-#_MAN_PAGE_SECTIONS = 0 3 7
-#_MAN_0 = libcolour.h
-#_MAN_3 =
-#_MAN_7 = libcolour
-
-# Used by mk/copy.mk
-_COPYING = COPYING
-
-# Used by mk/dist.mk
-___EVERYTHING_INFO = autohaltd titlepage-data content hardcopy-copying \
- appx/fdl appx/free-software-needs-free-documentation appx/gpl \
- reusable/macros reusable/paper reusable/titlepage \
- chap/overview chap/colour-spaces.texinfo chap/illuminants.texinfo \
- chap/functions.texinfo
-_EVERYTHING = $(__EVERYTHING_ALL_COMMON) DEPENDENCIES INSTALL NEWS \
- $(foreach F,$(___EVERYTHING_INFO),doc/info/$(F).texinfo) libcolour.h
-
-# }}
-
-
-# Reusable make rules and the configurations.
-include $(v)mk/all.mk
-