File: Makefile

package info (click to toggle)
ondir 0.2.3%2Bgit0.55279f03-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 188 kB
  • ctags: 53
  • sloc: ansic: 450; makefile: 70; sh: 13; csh: 2
file content (71 lines) | stat: -rw-r--r-- 1,831 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
# Change these as you see fit
PREFIX=/usr
CONF=/etc/ondirrc

SOURCES=conf.c ondir.c
HEADERS=conf.h ondir.h
OBJS=conf.o ondir.o
TARGET=ondir

VERSION=0.2.3
DESTDIR=

# Add -DUSE_ONENTERLEAVE to CFLAGS to enable support for .onenter/.onleave
# scripts.
# **WARNING** This is not recommended at all.

CC=cc
CFLAGS=-O3 -DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\" -DUSE_ONENTERLEAVE
CFLAGS=-Wall -c -g -DVERSION=\"$(VERSION)\" -DGLOBAL_CONF=\"$(CONF)\"

LD=cc
LDFLAGS=
LDFLAGS=-g

$(TARGET): $(OBJS)
	$(LD) $(OBJS) $(LDFLAGS) -o $@
	@echo
	@echo "OnDir is built."
	@echo
	@echo "Type 'make DESTDIR=<pkg-root> install' to install."
	@echo

clean:
	rm -f $(OBJS) $(TARGET)

install: $(TARGET)
	install -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1
	install -m 644 ondir.1 $(DESTDIR)$(PREFIX)/share/man/man1
	install -m 755 -d $(DESTDIR)$(PREFIX)/bin
	install -m 755 ondir $(DESTDIR)$(PREFIX)/bin

package: slackware rpm
	chown athomas:athomas *
	chmod og-rwx *
	chmod a+r ondir-$(VERSION)*
	
slackware: $(TARGET)
	# Make SlackWare package
	rm -rf /tmp/ondir.pkg && \
		make DESTDIR=/tmp/ondir.pkg PREFIX=/usr CONF=/etc/ondirrc install && \
		cd /tmp/ondir.pkg && \
		makepkg -l y -c y ${PWD}/ondir-$(VERSION)-i386-1.tgz && \
		rm -rf /tmp/ondir.pkg

rpm: dist $(TARGET)
	cp ondir-$(VERSION).tar.gz /usr/src/rpm/SOURCES
	rpm -ba ondir.spec
	cp /usr/src/rpm/SRPMS/ondir-$(VERSION)-1.src.rpm ${PWD}
	cp /usr/src/rpm/RPMS/i386/ondir-$(VERSION)-1.i386.rpm ${PWD}

dist: clean
	rm -f ondir-$(VERSION)* && \
		cd .. && \
		mv ondir ondir-$(VERSION) && \
		tar -czv --exclude '.git*' --exclude 'old/*' --exclude '.*.swp' -f ondir-$(VERSION).tar.gz ondir-$(VERSION) && \
		mv ondir-$(VERSION) ondir && \
		mv ondir-$(VERSION).tar.gz ondir && \
		chmod 644 ondir/ondir-$(VERSION).tar.gz

dep:
	@makedepend $(CXXFLAGS) $(SOURCES) 2> /dev/null