File: Makefile

package info (click to toggle)
yudit 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 18,472 kB
  • sloc: cpp: 76,344; perl: 5,630; makefile: 989; ansic: 823; sh: 441
file content (115 lines) | stat: -rw-r--r-- 2,615 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# This is a simple Makefile for one level c++ addons.
#
# Gaspar Sinai <gaspar@yudit.org>
# 2020-05-04, Tokyo
#
# If you see broken links here this is beta version.
#
include ../Makefile.conf

SOURCES=$(wildcard */*.cpp)

#
# In case you have those addons.
#
SYNTAX=../../syntax-1.6
TRUETYPE=../../truetype-1.14
# yudit_sedy-0.7.2 had a bug on arm64
YUDIT_SEDY=../../yudit_sedy-0.7.5


ifeq ($(SPLATFORM),WINDOWS)
OBJS=$(subst .cpp,.obj,$(SOURCES))
TARGET=addon.lib
else
OBJS=$(subst .cpp,.o,$(SOURCES))
TARGET=libaddon.a
endif

.PHONY: copy syntax

SUBDIRS=$(sort $(dir $(SOURCES)))
SUBDIR_CPP_FLAGS=$(patsubst %,-I$(TOPDIR)/addon/%,$(SUBDIRS))


CPPFLAGS:=$(CPPFLAGS) -DNO_MAIN

all: $(TARGET) syntax

syntax:
ifneq (,$(wildcard  syntax/*))
	$(MAKE) -C syntax all
endif

addon.lib: $(OBJS)
	$(AR)$@ $(OBJS)

libaddon.a: $(OBJS)
	$(AR) $@ $(OBJS)
	$(RANLIB) $@      

%.o:%.cpp
	$(CXX) -c -o $@ $(SUBDIR_CPP_FLAGS) $(CPPFLAGS) $(patsubst %.o,%.cpp,$@)

#Windows will create it in local, we need to move it
%.obj:%.cpp
	$(CXX) -c $(SUBDIR_CPP_FLAGS) $(CPPFLAGS) $(patsubst %.obj,%.cpp,$@)
	mv $(@F) $(@D)

depend:
	$(CXX) -M $(SUBDIR_CPP_FLAGS) $(CPPFLAGS)  $(patsubst %.o,%.cpp,$(OBJS)) > .depend

clean: 
	rm -f $(wildcard */*.o)   $(wildcard */*.obj) $(TARGET) .depend

distclean: clean
	rm -rf syntax truetype yudit_sedy

# In case you have WARNING: 'aclocal-1.13' is missing on your system.
# in syntax, you should touch these files in syntax-1.2/src/hunspell-1.3.0-cvs/
# touch configure.ac aclocal.m4 configure Makefile.am Makefile.in
# https://stackoverflow.com/questions/18769770/user-of-autotools-generated-tarball-gets-error-message-aclocal-1-13-command-no
# We hope original timestamps are correc, so we copy with -pR
copy:
ifneq (,$(wildcard  $(YUDIT_SEDY)/*))
	cp -pR $(YUDIT_SEDY) yudit_sedy
	rm -rf yudit_sedy/*.obj yudit_sedy/*.o
else
	@echo WARNING yudit_sedy plugin skipped.
endif
ifneq (,$(wildcard  $(SYNTAX)/*))
	cp -pR $(SYNTAX) syntax
else
	@echo WARNING syntax plugin skipped.
endif
ifneq (,$(wildcard  $(TRUETYPE)/*))
	cp -pR $(TRUETYPE) truetype
	make -C truetype all
	rm -rf truetype/reduced
	rm -rf truetype/candidate
else
	@echo WARNING truetype plugin skipped.
endif


install:

# This is called by bin/wininst on windows.
wininst_fonts:
ifneq (,$(wildcard  truetype/target/*))
	cp -R truetype/target/* $(INSTALLDIR)/fonts 
else
	@echo WARNING truetype plugin skipped.
endif

wininst_syntax:
ifneq (,$(wildcard  syntax/target/*))
	cp -R syntax/target/* $(INSTALLDIR)/syntax 
else
	@echo WARNING syntax plugin skipped
endif

ifeq (.depend, $(wildcard .depend))
include .depend
endif