File: Makefile

package info (click to toggle)
yudit 2.5.4-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,528 kB
  • ctags: 8,403
  • sloc: cpp: 59,394; ansic: 2,585; perl: 2,398; makefile: 864; sh: 321
file content (57 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download | duplicates (5)
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
include ../Makefile.conf

MODULES=Main.o ProcessFile.o
SUBDIRS=kmap mys uni hwd
CPPFLAGS:=$(CPPFLAGS) -DHAVE_STRTOL

ifeq ($(SPLATFORM),WINDOWS)
OBJS=$(subst .o,.obj,$(MODULES))
SLIBS=/libpath:../stoolkit stoolkit.lib
SWINLIBS=/libpath:../swindow 
MYLIBS=/link /subsystem:CONSOLE $(SWINLIBS) $(SLIBS) $(ALL_LIBS)
else
OBJS=$(MODULES)
SLIBS=-L../stoolkit -lstoolkit
SWINLIBS=-L../swindow -lswindow 
MYLIBS=$(SWINLIBS) $(SLIBS) $(ALL_LIBS)
endif

SUBDIRS_all:=$(foreach dir, $(SUBDIRS), $(dir)_all)
SUBDIRS_clean:=$(foreach dir, $(SUBDIRS), $(dir)_clean)

.PHONY:all clean config  $(SUBDIRS_all) $(SUBDIRS_clean)

all:  mytool $(SUBDIRS_all)

mytool: $(OBJS)
	$(LD) -o mytool $(OBJS) $(MYLIBS) 

%.o:%.cpp
	$(CXX) -c $(CPPFLAGS) $(subst .o,.cpp,$@)

%.obj:%.cpp
	$(CXX) -c $(CPPFLAGS) $(subst .obj,.cpp,$@)

$(SUBDIRS_all):
	$(MAKE) -C $(patsubst %_all,%,$@) all

clean: $(SUBDIRS_clean)
	rm -f *.o *.obj mytool mytool.exe

depend:
	$(CXX) -M  $(CPPFLAGS)  $(patsubst %.o,%.cpp,$(OBJS)) > .depend

install:
	rm -f $(DESTDIR)/$(bindir)/mytool
	@for i in $(SUBDIRS); do \
		cd $$i; $(MAKE) install; cd ..; \
	done
	$(INSTALL_PROGRAM) mytool $(DESTDIR)/$(bindir)
	$(INSTALL_DATA) mytool.1 $(DESTDIR)/$(mandir)/man1

$(SUBDIRS_clean):
	$(MAKE) -C $(patsubst %_clean,%,$@) clean

ifeq (.depend, $(wildcard .depend))
include .depend
endif