File: Makefile

package info (click to toggle)
trayer 1.0-5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 232 kB
  • ctags: 434
  • sloc: ansic: 2,877; makefile: 105
file content (80 lines) | stat: -rw-r--r-- 1,482 bytes parent folder | download | duplicates (2)
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
# Part 0
# load common stuff
TOPDIR = .
include $(TOPDIR)/Makefile.common

# Part 1
# recursive make
.PHONY: subdirs
all clean distclean install uninstall: subdirs

SUBDIRS = systray
.PHONY: $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
	$(MAKE) -C $@ $(MAKECMDGOALS)



SRC = panel.c misc.c plugin.c gtkbar.c bg.c 
OBJ = $(SRC:%.c=%.o)
DEP = $(SRC:%.c=%.dep)
MAN = trayer.1

SYSTRAYOBJ = systray/systray.o
SYSTRAYOBJ: systray


ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),tar)
-include $(DEP)
endif
endif
endif


TARGET = trayer
$(TARGET): $(OBJ) $(SYSTRAYOBJ)
	$(CC) $(LDFLAGS) $(LIBS) $(OBJ) $(SYSTRAYOBJ) -o $@

TARGETMAN = $(TARGET).1.gz
$(TARGETMAN): $(MAN)
	gzip -9 -c $(MAN) >$@

all: $(TARGET) $(TARGETMAN)


clean:
	$(RM) $(TARGET) $(OBJ) $(DEP) *~ $(TARGETMAN)

install: 
	install -d $(PREFIX)/bin $(PREFIX)/share/man/man1
	install -m 755 $(TARGET) $(PREFIX)/bin
	install -m 644 $(TARGETMAN) $(PREFIX)/share/man/man1

uninstall:
	rm -f $(PREFIX)/bin/$(TARGET)
	rm -f $(PREFIX)/share/man/man1/$(TARGETMAN)

.PHONY: tar


CWD=$(shell pwd)
VER=$(shell grep -e "\#define[[:space:]]\+VERSION[[:space:]]\+" panel.c | \
		sed -e 's/^[^\"]\+\"//' -e 's/\".*$$//' )


tar: 
	$(MAKE) distclean
	cd ..; \
	if [ -e trayer-$(VER) ]; then \
		echo trayer-$(VER) already exist; \
		echo "won't override";\
		exit 1;\
	else\
		ln -s $(CWD) trayer-$(VER);\
		tar --exclude CVS -hzcvf trayer-$(VER).tgz trayer-$(VER);\
		rm -f trayer-$(VER);\
	fi;