File: Makefile.win32

package info (click to toggle)
pecomato 0.0.15-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,116 kB
  • ctags: 1,324
  • sloc: ansic: 5,475; perl: 4,514; sh: 1,934; python: 1,271; makefile: 181
file content (226 lines) | stat: -rw-r--r-- 5,828 bytes parent folder | download | duplicates (6)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
include Makefile.win32.inc
include doc\Makefile.inc

CC      = cl
LINK    = link
CFLAGS  = -nologo -O2 -ML -GF -DOS_WIN32 -DPRODUCT_ID=\"$(PRODUCT)\" -DPRODUCT_VERSION=\"$(VERSION)\"
#CFLAGS += -MLd -Zi -Zm200
LFLAGS  = /NOLOGO /SUBSYSTEM:console
#LFLAGS += /DEBUG
INCPATH = -I"."

MAKE = $(MAKE) -f Makefile.win32

PREFIX     = %CD%\dist-win32
BIN_DIR    = $(PREFIX)
DATA_DIR   = $(PREFIX)
DOC_DIR    = $(DATA_DIR)\doc
SRC_PREFIX = %CD%\dist-src

TARGET   = $(PRODUCT).exe
OBJECTS  = $(PRODUCT).res adobe.obj exif.obj iptc.obj jfif.obj main.obj \
			gnu-strcasecmp.obj gnu-strndup.obj gnu-mkstemp.obj gnu-getline.obj \
			util.obj tiff.obj
DOC_DEFS = doc\Makefile.defs


default: all

syst:
	echo windows system: $(SYST) ($(SYSTBASE))

all: $(TARGET)

full: clean all

deps: $(OBJECTS)

doc: make-defs
	cd doc && \
		$(MAKE) all

$(TARGET): deps
	$(LINK) $(LFLAGS) /OUT:$(TARGET) @<<
	 $(OBJECTS)
<<

install: all install-dirs install-data install-bin

install-dirs::
	$(CHECK_NOT_EXIST_DIR) $(PREFIX) \
		$(CREATE_DIR) $(PREFIX)
	$(CHECK_NOT_EXIST_DIR) $(BIN_DIR) \
		$(CREATE_DIR) $(BIN_DIR)
	$(CHECK_NOT_EXIST_DIR) $(DATA_DIR) \
		$(CREATE_DIR) $(DATA_DIR)
	$(CHECK_NOT_EXIST_DIR) $(DOC_DIR) \
		$(CREATE_DIR) $(DOC_DIR)

install-data: install-doc

install-doc: make-defs
	cd doc && \
		$(MAKE) install

install-bin: $(TARGET)
	$(COPY_FILE) $(TARGET) $(BIN_DIR)\$(TARGET)

uninstall: uninstall-bin uninstall-data uninstall-dirs

uninstall-bin::
	-$(DEL_FILE) $(BIN_DIR)\$(TARGET)

uninstall-data: uninstall-doc

uninstall-doc: make-defs
	-cd doc && \
		$(MAKE) uninstall

uninstall-dirs::
	-$(DEL_DIR) $(DOC_DIR)
	-$(DEL_DIR) $(DATA_DIR)
	-$(DEL_DIR) $(BIN_DIR)
	-$(DEL_DIR) $(PREFIX)

clean: clean-doc clean-rc
	-$(DEL_FILE) $(TARGET)
	-$(DEL_FILE) *.obj
	-$(DEL_FILE) *.res
	-$(DEL_FILE) *.pdb
	-$(DEL_FILE) *.ilk

clean-doc: make-defs
	-cd doc && \
		$(MAKE) clean

clean-changelog:
	-$(DEL_FILE) ChangeLog*

clean-defs::
	-$(DEL_FILE) $(DOC_DEFS)

clean-rc::
	-$(DEL_FILE) $(PRODUCT).rc

clean-in::

dist: distbin distsrc

distbin: install distbin-zip distbin-rar distbin-7z distbin-exe

distbin-zip:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION)-$(SYST).zip
	cd $(PREFIX) && \
		$(ZIP) ..\$(PRODUCT)-$(VERSION)-$(SYST).zip *

distbin-rar:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION)-$(SYST).rar
	cd $(PREFIX) && \
		$(RAR) ..\$(PRODUCT)-$(VERSION)-$(SYST).rar *

distbin-7z:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION)-$(SYST).7z
	cd $(PREFIX) && \
		$(7ZIP) ..\$(PRODUCT)-$(VERSION)-$(SYST).7z *

distbin-exe:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION)-$(SYST).exe
	cd $(PREFIX) && \
		$(RARSFX) ..\$(PRODUCT)-$(VERSION)-$(SYST).exe *

distsrc: distsrc-prep distsrc-zip distsrc-rar distsrc-exe

distsrc-prep: make-changelog doc
	-$(CHECK_EXIST_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION) \
		$(DEL_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)
	$(CHECK_NOT_EXIST_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION) \
		$(CREATE_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)
	-$(CREATE_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\doc
	-$(CREATE_DIR) $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\devtools
	for %f in (ChangeLog $(MKFILES) $(SOURCES) $(RESOURCES)) do \
		$(COPY_FILE) %f $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\%f
	for %f in ($(DOC_SOURCES) $(DOC_MKFILES) $(DOC_RESOURCES)) do \
		$(COPY_FILE) %f $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\%f
	for %f in ($(TOOLS)) do \
		$(COPY_FILE) %f $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\%f
	$(COPY_FILE) doc\$(TXT_DIR)\DISCLAIMER.txt $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\DISCLAIMER
	$(COPY_FILE) doc\$(TXT_DIR)\INSTALL.txt $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\INSTALL
	$(COPY_FILE) doc\$(TXT_DIR)\LICENSE.txt $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\LICENSE
	$(COPY_FILE) doc\$(TXT_DIR)\README.txt $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\README
	$(COPY_FILE) doc\$(TXT_DIR)\TODO.txt $(SRC_PREFIX)\$(PRODUCT)-$(VERSION)\TODO

distsrc-zip:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION).zip
	cd $(SRC_PREFIX) && \
		$(ZIP) ..\$(PRODUCT)-$(VERSION).zip $(PRODUCT)-$(VERSION)

distsrc-rar:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION).rar
	cd $(SRC_PREFIX) && \
		$(RAR) ..\$(PRODUCT)-$(VERSION).rar $(PRODUCT)-$(VERSION)

distsrc-7z:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION).7z
	cd $(SRC_PREFIX) && \
		$(7ZIP) ..\$(PRODUCT)-$(VERSION).7z $(PRODUCT)-$(VERSION)

distsrc-exe:
	-$(DEL_FILE) $(PRODUCT)-$(VERSION).exe
	cd $(SRC_PREFIX) && \
		$(RARSFX) ..\$(PRODUCT)-$(VERSION).exe $(PRODUCT)-$(VERSION)

distcvs: distsrc-prep distsrc-zip distsrc-rar distsrc-7z distsrc-exe
	$(RENAME_FILE) $(PRODUCT)-$(VERSION).zip $(PRODUCT)-cvs-snapshot.zip
	$(RENAME_FILE) $(PRODUCT)-$(VERSION).rar $(PRODUCT)-cvs-snapshot.rar
	$(RENAME_FILE) $(PRODUCT)-$(VERSION).exe $(PRODUCT)-cvs-snapshot.exe

distclean: uninstall clean distclean-doc clean-changelog clean-defs clean-in
	-$(DEL_DIR) dist-win32
	-$(DEL_DIR) dist-src

distclean-doc: make-defs
	-cd doc && \
		$(MAKE) distclean

make-changelog::
	$(CHECK_NOT_EXIST_FILE) ChangeLog \
		$(PERL) $(CVS2CL)

make-defs::
	echo INSTALL_HTML_DIR = $(DOC_DIR)\html > $(DOC_DEFS)
	echo INSTALL_TXT_DIR = $(DOC_DIR)\txt >> $(DOC_DEFS)
	echo INSTALL_MAN_DIR = $(DOC_DIR)\man >> $(DOC_DEFS)

$(PRODUCT).rc: $(PRODUCT).rc.in
	-$(DEL_FILE) $(PRODUCT).rc
	sed -e "s/@PRODUCT@/$(PRODUCT)/g" -e "s/@VERSION@/$(VERSION)/g" -e "s/@DESCRIPTION@/$(DESCRIPTION)/g" \
		-e "s/@AUTHOR_CONTACT@/$(AUTHOR_CONTACT)/g" -e "s/@HOMEPAGE@/$(HOMEPAGE)/g" -e "s/@CATEGORY@/$(CATEGORY)/g" \
		-e "s/@LICENSE@/$(LICENSE)/g" -e "s/@VERSION_RC@/$(VERSION_RC)/g" $(PRODUCT).rc.in > $(PRODUCT).rc

.SUFFIXES: .c .rc

{.}.c{.}.obj::
	$(CC) -c $(CFLAGS) $(INCPATH) -Fo.\ @<<
	$<
<<

{.}.rc{.}.res::
	rc @<<
	$<
<<

$(PRODUCT).res: $(PRODUCT).rc

adobe.obj: adobe.c adobe.h config.h

exif.obj: exif.c exif.h config.h

iptc.obj: iptc.c iptc.h config.h

jfif.obj: jfif.c jfif.h config.h

main.obj: main.c config.h

util-gnu.obj: util-gnu.c util-gnu.h config.h

util.obj: util.c util.h config.h