aboutsummaryrefslogtreecommitdiff
path: root/jindroush/adir/Makefile
blob: cf025beb8e4156f17e8fb668ca986de4dcc89f95 (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
#=====================================================================
PRGNAME		= adir

DESTDIR=
PREFIX=/usr

LDLIBS=-L../lib -ljindroush
INCPATH=-I../include

all: release

release:
	@$(MAKE) $(PRGNAME) CFLAGS="-c -O2 -Wall -D__CDISK_SAVE__" LDFLAGS=""

rel_strip: release
	@strip $(PRGNAME)

install: rel_strip
	cp $(PRGNAME) $(DESTDIR)/$(PREFIX)/bin/

debug:
	@$(MAKE) $(PRGNAME) CFLAGS="-c -g -Wall -D_DEBUG -D__CDISK_SAVE__" LDFLAGS="-g"

clean:
	rm -rf *.o $(PRGNAME) $(PRGNAME).exe switches.cpp


OBJECTS = adir.o

#=====================================================================
CXX		= g++
LD		= g++
CPPFLAGS=$(COPT)
COPT=-O2

#=====================================================================

$(PRGNAME) : $(OBJECTS)
	$(LD) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $(PRGNAME)

%.o : %.cpp switches.cpp
	$(CXX) $(INCPATH) $(CPPFLAGS) $(CFLAGS) $< -o $@

%.o : %.cpp
	$(CXX) $(INCPATH) $(CPPFLAGS) $(CFLAGS) $< -o $@

switches.cpp : switches.def ../switches.pl
	perl ../switches.pl $< $@