File: Makefile

package info (click to toggle)
sciteproj 1.72-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 616 kB
  • sloc: ansic: 5,423; makefile: 167; xml: 8
file content (112 lines) | stat: -rw-r--r-- 3,398 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
#
#   Copyright (C) 2009-2023 Andreas Rönnquist
#   This file is distributed under the same license
#   as the sciteproj package, see COPYING file.
#

ifndef CC
	CC=gcc
endif
ifndef PKG_CONFIG
	PKG_CONFIG=pkg-config
endif
SRC=src
BIN=bin
GRPH=graphics
OBJ=obj

ifdef DEBUG
	STD_CFLAGS=-Wall -g3 -ggdb -D_DEBUG
else
	STD_CFLAGS=-Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 -Wdeprecated-declarations
endif

OBJECTS=$(OBJ)/about.o $(OBJ)/clipboard.o $(OBJ)/clicked_node.o \
$(OBJ)/create_folder.o $(OBJ)/delete.o $(OBJ)/dialogs.o $(OBJ)/expand.o \
$(OBJ)/file_utils.o $(OBJ)/graphics.o $(OBJ)/gui.o $(OBJ)/gui_callbacks.o \
$(OBJ)/load_folder.o $(OBJ)/launch_external.o $(OBJ)/menus.o $(OBJ)/main.o \
$(OBJ)/prefs.o $(OBJ)/properties_dialog.o $(OBJ)/recent_files.o $(OBJ)/remove.o \
$(OBJ)/scite_utils.o $(OBJ)/script.o $(OBJ)/selection.o $(OBJ)/sort.o \
$(OBJ)/statusbar.o $(OBJ)/string_utils.o $(OBJ)/tree_manipulation.o \
src/icons/icons_resources.o

ifndef PREFIX
	ifdef INSTALL_PREFIX
		PREFIX=$(INSTALL_PREFIX)
	else
		PREFIX=/usr/local
	endif
endif

NAME=sciteproj
PROG=${BIN}/${NAME}
DEPEND=Makefile.dep
DATADIR= ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale
VERSION=$(shell cat ./VERSION)

PKG_GTK=gtk+-3.0
CHECK_GTK3=1

LIB_CFLAGS=$(shell $(PKG_CONFIG) --cflags --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.3 || $(PKG_CONFIG) --cflags $(PKG_GTK) $(PKG_WNCK) lua)
STD_LDFLAGS=
LIBS=-lX11 $(shell $(PKG_CONFIG) --libs --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.3 || $(PKG_CONFIG) --libs $(PKG_GTK) $(PKG_WNCK) lua)

LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS)
LOCAL_LDFLAGS=$(STD_CFLAGS) $(LDFLAGS) $(STD_LDFLAGS)

LOCAL_CPPFLAGS=$(CPPFLAGS)

LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
LOCAL_CFLAGS+=-DGSEAL_ENABLE

LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED

LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DSCITEPROJ_VERSION=\"$(VERSION)\"

all: $(BIN)/$(NAME) sciteproj.1.gz
	${MAKE} -C po -j1 all


src/icons/icons_resources.o: src/icons/icons_resources.c src/icons/icons_resources.h
	$(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@

$(OBJ)/%.o: $(SRC)/%.c
	$(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@

$(BIN)/$(NAME): $(OBJECTS)
	$(CC) $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) $(OBJECTS) -o $(PROG) $(LIBS)

sciteproj.1.gz: sciteproj.1
	gzip -k sciteproj.1

src/icons/icons_resources.c: ./src/icons/icons.gresource.xml
	${MAKE} -C src/icons

clean:
	rm -rf $(OBJECTS) $(PROG)
	rm -f sciteproj.1.gz
	rm -rf Makefile.dep
	${MAKE} -C po clean
	${MAKE} -C src/icons clean

install:
	install -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin
	install -d $(DESTDIR)$(PREFIX)/share/man/man1
	install -m 644 sciteproj.1.gz $(DESTDIR)$(PREFIX)/share/man/man1
	${MAKE} -C po install

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/$(PROG)
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/sciteproj.1.gz
	${MAKE} -C po uninstall
	${MAKE} -C src/icons uninstall

cppcheck:
	cppcheck --suppress=missingIncludeSystem --suppress=unmatchedSuppression:src/script.c -i src/icons/icons_resources.c --inline-suppr --enable=all ./src/

$(DEPEND): src/icons/icons_resources.c
	$(CC) $(LOCAL_CFLAGS) -MM $(SRC)/*.c src/icons/icons_resources.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" -e "s/obj\/C\:/\/C/g" > $(DEPEND)

-include $(DEPEND)