forked from martynets/ruthyn-hd44780
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (50 loc) · 2.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#############################################################################################################
# Project, libraries and installation pathes
#############################################################################################################
# The directory below needs to be adjusted for the target system.
# The module must be added to/removed from the gconv-modules file located in the target directory.
# It is expected the module is installed in to a custom directory which is later passed to iconv based
# application (e.g. gcc) in GCONV_PATH variable. If one decides to install the module to the system default
# gconv directory the iconvconfig command must be issued then.
TARGETDIR = ../gconv
# List directories to look for prerequisites in
VPATH = ./
#############################################################################################################
# Commands and their arguments
#############################################################################################################
# Declare GNU toolchain command line tools
CC = gcc
INSTALL = install -m 755 -p -s -D -t
SED = sed
# Declare command line flags
CFLAGS_SO = $(addprefix -I, $(VPATH)) -O3 -fpic -shared
#############################################################################################################
# Prerequisites and targets
#############################################################################################################
TARGET = ruthyn-hd44780.so
# Name of the codepage implemented by the target
CODEPAGE = RUTHYN-HD44780
# Convenient alias to the codepage
ALIAS = ruthyn
# List header files
HEADER_FILES = ruthyn_alphabet_hd44780.h
#############################################################################################################
# Rules
#############################################################################################################
$(TARGET):
# Generic rules
.PHONY: clean uninstall install
install: $(TARGET)
$(INSTALL) "$(TARGETDIR)" "$(TARGET)"
@touch "$(TARGETDIR)/gconv-modules"
@$(SED) --in-place --follow-symlinks /$(CODEPAGE)/d "$(TARGETDIR)/gconv-modules"
@echo "alias $(ALIAS)// $(CODEPAGE)//" >> "$(TARGETDIR)/gconv-modules"
@echo "module INTERNAL $(CODEPAGE)// $(basename $(TARGET)) 1" >> "$(TARGETDIR)/gconv-modules"
uninstall:
$(RM) "$(TARGETDIR)/$(TARGET)"
@$(SED) --in-place --follow-symlinks /$(CODEPAGE)/d "$(TARGETDIR)/gconv-modules"
clean:
$(RM) "$(TARGET)"
# Build rules
%.so: %.c $(HEADER_FILES)
$(CC) $(CFLAGS_SO) -o $@ $<