File: Makefile

package info (click to toggle)
ztex-bmp 20120314-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 324 kB
  • ctags: 184
  • sloc: pascal: 1,767; sh: 208; makefile: 75
file content (127 lines) | stat: -rw-r--r-- 2,407 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright (C) 1999-2011 Stefan Ziegenbalg
#
# main targets:
#   all             build bmp
#   install         install applications
#   install2        install applications to ../bin
#   uninstall       uninstall applications
#   resetconf       reset configuration
#   clean           clean everything but exe's
#   distclean       clean everything

#########################
# configuration section #
#########################
#OS  operating system (UNIX for unix like OS)
#default: detected automatically
#e.g. OS=UNIX

#PCEXTRAFLAGS  additional flags
#e.g. PCEXTRAFLAGS=-Xs
PCEXTRAFLAGS=-gl

#PREFIX  base directory for installing 
#default: /usr/local for OS=UNIX and c:\usr else
#e.g. PREFIX=/usr

#BINDIR  where to install bin's
#default: $(PREFIX)/bin
#e.g. BINDIR=/usr/bin

#MANDIR  where to install mans's
#default: $(PREFIX)/share/man/man1

################################
# DO NOT CHANAGE THE FOLLOWING #
################################
ifndef OS
ifeq ($(WINDIR),)
OS=UNIX
else
OS=WINDOS
endif
endif

SOURCES=src/bmp.pas src/bmpsys.pas src/textbuf.pas 

UNITS=-Fusrc

PCFLAGS:=-Scgm -O3rGp3 -FE. -XD $(PCEXTRAFLAGS)
INSTALLDIR=$(INSTALL) -d 
INSTALLEXE=$(INSTALL) -m 0755
INSTALLFILE=$(INSTALL) -m 0644
RM=rm -f

ifeq ($(OS),UNIX)

TOUCH=touch
CONFIGURESCRIPT=./configure
PC:=$(shell $(CONFIGURESCRIPT) pc "$(PCFLAGS)")
ifndef PC
    $(error Fatal: No correct compiler found or wrong flags)
endif    
INSTALL=$(shell $(CONFIGURESCRIPT) install2)

ifndef PREFIX
  PREFIX=/usr/local
endif

TARGETS=bmp
DEFS=-DUNIX

else

PC=ppc386
INSTALL=install
TOUCH=echo >

ifndef PREFIX
  PREFIX=c:\usr
endif

TARGETS=bmp.exe
DEFS=-DWINDOWS

endif

ifndef BINDIR
  BINDIR=$(DESTDIR)$(PREFIX)/bin
endif

ifndef MANDIR
  MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1
endif

.PHONY: all install uninstall resetconf clean distclean

all: bmp.made

bmp.made: $(TARGETS)
	$(TOUCH) $@

bmp bmp.exe: $(SOURCES)
	$(PC) $(PCFLAGS) $(UNITS) src/bmp.pas

install: $(TARGETS)
	$(INSTALLDIR) $(BINDIR)
	$(INSTALLEXE) $(TARGETS) $(BINDIR)
	$(INSTALLDIR) $(MANDIR)
	$(INSTALLFILE) bmp.1 $(MANDIR)

install2: $(TARGETS)
	$(INSTALLEXE) $(TARGETS) ../bin

uninstall:
	- $(RM) $(addprefix $(BINDIR)/,$(TARGETS))

resetconf: 
	- $(RM) Makefile.conf
	- $(RM) conf_*
  
clean:
	- $(RM) *.bak *.o *.ppu *.s */*.bak *.log *.a *~ */*~ *.out
	- $(RM) ppas.sh link.res
	
	
distclean: clean resetconf
	- $(RM) bmp bmp.exe bmp.made bmp.pas