-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
51 lines (40 loc) · 1.4 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
include config.mk
NAME_DEFINES = -D__NAME__=\"$(__NAME__)\" \
-D__NAME_CLIENT__=\"$(__NAME_CLIENT__)\" \
-D__THIS_VERSION__=\"$(__THIS_VERSION__)\" \
-D__CONFIG_NAME__=\"$(__CONFIG_NAME__)\" \
SRC = helpers.c wm.c client.c
OBJ = $(SRC:.c=.o)
BIN = $(__NAME__) $(__NAME_CLIENT__)
CFLAGS += $(NAME_DEFINES)
all: $(BIN)
debug: CFLAGS += -O0 -g -DD
debug: $(__NAME__) $(__NAME_CLIENT__)
$(__NAME__): wm.o helpers.o
@echo $@
@$(CC) -o $@ $^ $(LDFLAGS)
$(__NAME_CLIENT__): client.o
@echo $@
@$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c
@echo $@
@$(CC) -o $@ -c $(CFLAGS) $<
$(OBJ): common.h helpers.h ipc.h types.h config.h
install: all
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
install $(__NAME__) "$(DESTDIR)$(PREFIX)/bin/$(__NAME__)"
install $(__NAME_CLIENT__) "$(DESTDIR)$(PREFIX)/bin/$(__NAME_CLIENT__)"
mkdir -p "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -fR contrib "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -fR examples "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -f README.md LICENSE "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cd ./man; $(MAKE) install
install -D windowchef.desktop "$(DESTDIR)$(XSESSIONS)/"windowchef.desktop
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/$(__NAME__)"
rm -f "$(DESTDIR)$(PREFIX)/bin/$(__NAME_CLIENT__)"
rm -rf "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)"
rm -rf "$(DESTDIR)$(XSESSIONS)/windowchef.desktop"
cd ./man; $(MAKE) uninstall
clean:
rm -f $(OBJ) $(BIN)