aboutsummaryrefslogtreecommitdiff
blob: 92be1b4e7dfba8cf8571d138248aa00c74399e68 (plain)
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
--- dmd_gtk-2.1.0.orig/Makefile	2024-07-13 00:17:40.231937343 +0300
+++ dmd_gtk-2.1.0/Makefile	2024-07-13 00:32:41.311218471 +0300
@@ -3,27 +3,22 @@
 CC = gcc
 GIT = git
 CARGO = cargo
-CFLAGS = $(shell pkg-config --cflags gtk+-3.0) -Wall -std=gnu99
+CFLAGS = $(shell printenv CFLAGS)
+CFLAGS += $(shell pkg-config --cflags gtk+-3.0) -Wall -std=gnu99
 GTKLIBS = $(shell pkg-config --libs gtk+-3.0)
 EXE = dmd5620
 CSRC = $(wildcard src/*.c)
 OBJ = $(CSRC:.c=.o)
-LDFLAGS = $(GTKLIBS) -lm -lpthread -lc -ldl -lutil
-CORELIB = $(LIBDIR)/target/release/libdmd_core.a
+LDFLAGS = $(shell printenv LDFLAGS)
+LDFLAGS += $(GTKLIBS) -lm -lpthread -lc -ldl
+CORELIB = $(shell pkg-config --libs dmd_core)
 
 ifeq ($(PREFIX),)
 PREFIX := /usr/local
 endif
 
 ifdef DEBUG
-	CFLAGS+ = -g -O0
-else
-	UNAME_S := $(shell uname -s)
-	ifeq ($(UNAME_S),Darwin)
-		CFLAGS += -O3 -Os
-	else
-		CFLAGS += -O3 -Os -s
-	endif
+	CFLAGS += -g
 endif
 
 .PHONY: all clean
@@ -34,18 +29,14 @@
 	@rm -f $(EXE) $(OBJ)
 	@cd $(LIBDIR) && $(CARGO) clean
 
-$(CORELIB):
-	$(if $(wildcard ./dmd_core/Cargo.toml),,$(error The submodule dmd_core is not checked out.))
-	@cd $(LIBDIR) && $(CARGO) build --release
-
-$(EXE): $(CORELIB) $(OBJ)
+$(EXE): $(OBJ)
 	@$(CC) $(CFLAGS) -o $@ $^ $(CORELIB) $(LDFLAGS)
 
 install: $(EXE)
 	install -d $(DESTDIR)$(PREFIX)/bin
 	install -m 755 $(EXE) $(DESTDIR)$(PREFIX)/bin
-	install -d $(DESTDIR)$(PREFIX)/man/man1
-	install -m 644 dmd5620.man $(DESTDIR)$(PREFIX)/man/man1/dmd5620.1
+	install -d $(DESTDIR)$(PREFIX)/share/man/man1
+	install -m 644 dmd5620.man $(DESTDIR)$(PREFIX)/share/man/man1/dmd5620.1
 	install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
 	install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
 	install -m 644 assets/dmd5620.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
@@ -55,4 +46,4 @@
 	rm -f $(DESTDIR)$(PREFIX)/bin/$(EXE)
 	rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/dmd5620.png
 	rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/dmd5620.svg
-	rm -f $(DESTDIR)$(PREFIX)/man/man1/dmd5620.1
+	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/dmd5620.1