aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile66
-rw-r--r--Makefile.in74
2 files changed, 66 insertions, 74 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ab595c6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,66 @@
+.POSIX:
+
+LIB_MAJOR = 1
+LIB_MINOR = 2
+LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
+
+CONFIGFILE = config.mk
+OSCONFIGFILE = linux.mk
+
+include $(CONFIGFILE)
+include $(OSCONFIGFILE)
+include man.mk
+
+all: libcoopgamma.a libcoopgamma.so test
+
+.c.o:
+ $(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
+
+.c.lo:
+ $(CC) -fPIC -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
+
+libcoopgamma.a: libcoopgamma.o
+ $(AR) rc $@ $?
+ $(AR) s $@
+
+libcoopgamma.$(LIBEXT): libcoopgamma.lo
+ $(CC) $(LIBFLAGS) -o $@ libcoopgamma.lo $(LDFLAGS)
+
+test: test.o libcoopgamma.a
+ $(CC) -o $@ test.o libcoopgamma.a $(LDFLAGS)
+
+check: test
+ ./test
+
+install: libcoopgamma.a libcoopgamma.$(LIBEXT)
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man0"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man3"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man7"
+ cp -- libcoopgamma.h "$(DESTDIR)$(PREFIX)/include"
+ cp -- libcoopgamma.a "$(DESTDIR)$(PREFIX)/lib"
+ cp -- libcoopgamma.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBMINOREXT)"
+ ln -sf -- libcoopgamma.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBMAJOREXT)"
+ ln -sf -- libcoopgamma.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBEXT)"
+ cp -- $(MAN0) "$(DESTDIR)$(MANPREFIX)/man0"
+ cp -- $(MAN3) "$(DESTDIR)$(MANPREFIX)/man3"
+ cp -- $(MAN7) "$(DESTDIR)$(MANPREFIX)/man7"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libcoopgamma.h"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBMINOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBMAJOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libcoopgamma.$(LIBEXT)"
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man0/" && rm -f -- $(MAN0)
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man3/" && rm -f -- $(MAN3)
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man7/" && rm -f -- $(MAN7)
+
+clean:
+ -rm -f -- *.a *.lo *.o *.su *.$(LIBEXT) test
+
+.SUFFIXES:
+.SUFFIXES: .lo .o .c
+
+.PHONY: all check install uninstall clean
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index b3a1e2e..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,74 +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. #####
-
-
-# The name of the package as it should be installed.
-PKGNAME = libcoopgamma
-
-
-
-##### 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 = libcoopgamma
-_VERSION = 1.2
-
-# Used by mk/lang-c.mk
-_C_STD = c99
-_PEDANTIC = yes
-_LIB = libcoopgamma
-_OBJ_libcoopgamma = libcoopgamma
-_SO_VERSION_libcoopgamma = $(_VERSION)
-_SO_MAJOR_libcoopgamma = $(shell echo $(_SO_VERSION_libcoopgamma) | cut -d . -f 1)
-_H = libcoopgamma
-_HEADER_DIRLEVELS = 1
-_CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"'
-
-# Used by mk/man.mk
-_MAN_PAGE_SECTIONS = 0 3 7
-_MAN_0 = libcoopgamma.h
-__TYPES = async_context context crtc_info error filter filter_query filter_table queried_filter ramps
-__PROTOCOLS = get_crtcs get_gamma_info get_gamma set_gamma
-_MAN_3 = $(foreach T,$(__TYPES),$(foreach F,destroy initialise marshal unmarshal,libcoopgamma_$(T)_$(F))) \
- $(foreach P,$(__PROTOCOLS),$(foreach F,recv send sync,libcoopgamma_$(P)_$(F))) \
- libcoopgamma_connect libcoopgamma_flush libcoopgamma_get_method_and_site \
- libcoopgamma_get_methods libcoopgamma_get_pid_file libcoopgamma_get_socket_file \
- libcoopgamma_set_nonblocking libcoopgamma_synchronise libcoopgamma_skip_message
-_MAN_7 = libcoopgamma
-
-# Used by mk/copy.mk
-_COPYING = COPYING LICENSE
-
-# Used by mk/dist.mk
-_EVERYTHING = $(__EVERYTHING_ALL_COMMON) src/libcoopgamma.c src/libcoopgamma.h \
- DEPENDENCIES
-
-# }}
-
-
-# All of the make rules and the configurations.
-include $(v)mk/all.mk
-