author | Ryan C. Gordon <icculus@icculus.org> |
Fri, 05 Apr 2002 18:20:51 +0000 | |
changeset 182 | a47c39af46ad |
parent 180 | f67e3d2ddd9c |
child 194 | 09c353d30cd4 |
permissions | -rw-r--r-- |
9 | 1 |
#-----------------------------------------------------------------------------# |
2 |
# PhysicsFS -- A filesystem abstraction. |
|
3 |
# |
|
4 |
# Please see the file LICENSE in the source's root directory. |
|
5 |
# This file written by Ryan C. Gordon. |
|
6 |
#-----------------------------------------------------------------------------# |
|
7 |
||
8 |
||
9 |
#-----------------------------------------------------------------------------# |
|
10 |
# Makefile for building PhysicsFS on Unix-like systems. Follow the |
|
11 |
# instructions for editing this file, then run "make" on the command line. |
|
12 |
#-----------------------------------------------------------------------------# |
|
13 |
||
14 |
||
15 |
#-----------------------------------------------------------------------------# |
|
16 |
# Set to your liking. |
|
17 |
#-----------------------------------------------------------------------------# |
|
18 |
CC = gcc |
|
19 |
LINKER = gcc |
|
20 |
||
21 |
||
22 |
#-----------------------------------------------------------------------------# |
|
23 |
# If this makefile fails to detect Cygwin correctly, or you want to force |
|
24 |
# the build process's behaviour, set it to "true" or "false" (w/o quotes). |
|
25 |
#-----------------------------------------------------------------------------# |
|
26 |
#cygwin := true |
|
27 |
#cygwin := false |
|
28 |
cygwin := autodetect |
|
29 |
||
30 |
#-----------------------------------------------------------------------------# |
|
31 |
# Set this to true if you want to create a debug build. |
|
32 |
#-----------------------------------------------------------------------------# |
|
33 |
#debugging := false |
|
34 |
debugging := true |
|
35 |
||
36 |
#-----------------------------------------------------------------------------# |
|
37 |
# Set the archive types you'd like to support. |
|
38 |
# Note that various archives may need external libraries. |
|
39 |
#-----------------------------------------------------------------------------# |
|
43 | 40 |
use_archive_zip := true |
21
b1ea58d70a56
Archive implementation (Build Groupfiles), other tweaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
20
diff
changeset
|
41 |
use_archive_grp := true |
9 | 42 |
|
43 |
#-----------------------------------------------------------------------------# |
|
44 |
# Set to "true" if you'd like to build a DLL. Set to "false" otherwise. |
|
45 |
#-----------------------------------------------------------------------------# |
|
46 |
#build_dll := false |
|
47 |
build_dll := true |
|
48 |
||
49 |
#-----------------------------------------------------------------------------# |
|
50 |
# Set one of the below. Currently, none of these are used. |
|
51 |
#-----------------------------------------------------------------------------# |
|
52 |
#use_asm = -DUSE_I386_ASM |
|
53 |
use_asm = -DUSE_PORTABLE_C |
|
54 |
||
55 |
||
56 |
#-----------------------------------------------------------------------------# |
|
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
57 |
# Set this to where you want PhysicsFS installed. It will put the |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
58 |
# files in $(install_prefix)/bin, $(install_prefix)/lib, and |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
59 |
# $(install_prefix)/include ... |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
60 |
#-----------------------------------------------------------------------------# |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
61 |
install_prefix := /usr/local |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
62 |
|
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
63 |
|
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
64 |
#-----------------------------------------------------------------------------# |
9 | 65 |
#-----------------------------------------------------------------------------# |
66 |
#-----------------------------------------------------------------------------# |
|
67 |
#-----------------------------------------------------------------------------# |
|
68 |
# Everything below this line is probably okay. |
|
69 |
#-----------------------------------------------------------------------------# |
|
70 |
#-----------------------------------------------------------------------------# |
|
71 |
#-----------------------------------------------------------------------------# |
|
72 |
#-----------------------------------------------------------------------------# |
|
73 |
||
74 |
#-----------------------------------------------------------------------------# |
|
75 |
# CygWin autodetect. |
|
76 |
#-----------------------------------------------------------------------------# |
|
77 |
||
78 |
ifeq ($(strip $(cygwin)),autodetect) |
|
79 |
ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),) |
|
80 |
cygwin := true |
|
81 |
else |
|
82 |
cygwin := false |
|
83 |
endif |
|
84 |
endif |
|
85 |
||
86 |
||
87 |
#-----------------------------------------------------------------------------# |
|
88 |
# Platform-specific binary stuff. |
|
89 |
#-----------------------------------------------------------------------------# |
|
90 |
||
91 |
ifeq ($(strip $(cygwin)),true) |
|
92 |
# !!! FIXME |
|
93 |
build_dll := false |
|
94 |
# !!! FIXME |
|
95 |
||
96 |
ASM = nasmw |
|
97 |
EXE_EXT = .exe |
|
98 |
DLL_EXT = .dll |
|
99 |
STATICLIB_EXT = .a |
|
100 |
ASMOBJFMT = win32 |
|
101 |
ASMDEFS = -dC_IDENTIFIERS_UNDERSCORED |
|
102 |
CFLAGS += -DC_IDENTIFIERS_UNDERSCORED |
|
103 |
else |
|
104 |
ASM = nasm |
|
105 |
EXE_EXT = |
|
106 |
DLL_EXT = .so |
|
107 |
STATICLIB_EXT = .a |
|
108 |
ASMOBJFMT = elf |
|
109 |
endif |
|
110 |
||
111 |
ifeq ($(strip $(build_dll)),true) |
|
112 |
LIB_EXT := $(DLL_EXT) |
|
34 | 113 |
SHAREDFLAGS += -shared |
9 | 114 |
else |
115 |
LIB_EXT := $(STATICLIB_EXT) |
|
116 |
endif |
|
117 |
||
118 |
#-----------------------------------------------------------------------------# |
|
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
119 |
# Version crapola. |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
120 |
#-----------------------------------------------------------------------------# |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
121 |
VERMAJOR := $(shell grep "define PHYSFS_VER_MAJOR" physfs.h | sed "s/\#define PHYSFS_VER_MAJOR //") |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
122 |
VERMINOR := $(shell grep "define PHYSFS_VER_MINOR" physfs.h | sed "s/\#define PHYSFS_VER_MINOR //") |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
123 |
VERPATCH := $(shell grep "define PHYSFS_VER_PATCH" physfs.h | sed "s/\#define PHYSFS_VER_PATCH //") |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
124 |
|
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
125 |
VERMAJOR := $(strip $(VERMAJOR)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
126 |
VERMINOR := $(strip $(VERMINOR)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
127 |
VERPATCH := $(strip $(VERPATCH)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
128 |
|
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
129 |
VERFULL := $(VERMAJOR).$(VERMINOR).$(VERPATCH) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
130 |
|
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
131 |
#-----------------------------------------------------------------------------# |
9 | 132 |
# General compiler, assembler, and linker flags. |
133 |
#-----------------------------------------------------------------------------# |
|
134 |
||
135 |
BINDIR := bin |
|
136 |
SRCDIR := . |
|
137 |
||
36
60b6076ae5c2
Added readline library to test program.
Ryan C. Gordon <icculus@icculus.org>
parents:
34
diff
changeset
|
138 |
CFLAGS += $(use_asm) -I$(SRCDIR) -I/usr/include/readline -D_REENTRANT -fsigned-char -DPLATFORM_UNIX |
132
b53fa5093749
Added typedefs and platform-specific i/o.
Ryan C. Gordon <icculus@icculus.org>
parents:
125
diff
changeset
|
139 |
CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi |
b53fa5093749
Added typedefs and platform-specific i/o.
Ryan C. Gordon <icculus@icculus.org>
parents:
125
diff
changeset
|
140 |
#-pedantic |
9 | 141 |
|
142 |
LDFLAGS += -lm |
|
143 |
||
144 |
ifeq ($(strip $(debugging)),true) |
|
145 |
CFLAGS += -DDEBUG -g -fno-omit-frame-pointer |
|
146 |
LDFLAGS += -g -fno-omit-frame-pointer |
|
147 |
else |
|
148 |
CFLAGS += -DNDEBUG -O2 -fomit-frame-pointer |
|
149 |
LDFLAGS += -O2 -fomit-frame-pointer |
|
150 |
endif |
|
151 |
||
152 |
ASMFLAGS := -f $(ASMOBJFMT) $(ASMDEFS) |
|
153 |
||
36
60b6076ae5c2
Added readline library to test program.
Ryan C. Gordon <icculus@icculus.org>
parents:
34
diff
changeset
|
154 |
TESTLDFLAGS := -lreadline |
9 | 155 |
|
156 |
#-----------------------------------------------------------------------------# |
|
157 |
# Source and target names. |
|
158 |
#-----------------------------------------------------------------------------# |
|
159 |
||
81
0a0cd7fb0208
Fixed link command line so that test_physfs links with libphysfs.so correctly.
Ryan C. Gordon <icculus@icculus.org>
parents:
74
diff
changeset
|
160 |
PUREBASELIBNAME := physfs |
0a0cd7fb0208
Fixed link command line so that test_physfs links with libphysfs.so correctly.
Ryan C. Gordon <icculus@icculus.org>
parents:
74
diff
changeset
|
161 |
ifeq ($(strip $(cygwin)),true) |
0a0cd7fb0208
Fixed link command line so that test_physfs links with libphysfs.so correctly.
Ryan C. Gordon <icculus@icculus.org>
parents:
74
diff
changeset
|
162 |
BASELIBNAME := $(strip $(PUREBASELIBNAME)) |
0a0cd7fb0208
Fixed link command line so that test_physfs links with libphysfs.so correctly.
Ryan C. Gordon <icculus@icculus.org>
parents:
74
diff
changeset
|
163 |
else |
0a0cd7fb0208
Fixed link command line so that test_physfs links with libphysfs.so correctly.
Ryan C. Gordon <icculus@icculus.org>
parents:
74
diff
changeset
|
164 |
BASELIBNAME := lib$(strip $(PUREBASELIBNAME)) |
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
165 |
endif |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
166 |
|
9 | 167 |
MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) |
168 |
||
34 | 169 |
TESTSRCS := test/test_physfs.c |
170 |
||
180
f67e3d2ddd9c
Added physfs_byteorder.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
132
diff
changeset
|
171 |
MAINSRCS := physfs.c physfs_byteorder.c archivers/dir.c |
9 | 172 |
|
173 |
ifeq ($(strip $(use_archive_zip)),true) |
|
74
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
174 |
MAINSRCS += archivers/zip.c archivers/unzip.c |
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
175 |
CFLAGS += -DPHYSFS_SUPPORTS_ZIP |
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
176 |
LDFLAGS += -lz |
74
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
177 |
ifeq ($(strip $(cygwin)),true) |
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
178 |
EXTRABUILD += zlibwin32/zlib.a |
74
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
179 |
CFLAGS += -Izlibwin32 |
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
180 |
LDFLAGS += -Lzlibwin32 |
74
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
181 |
endif |
71 | 182 |
endif |
9 | 183 |
|
22
49f6101707b4
More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents:
21
diff
changeset
|
184 |
ifeq ($(strip $(use_archive_grp)),true) |
49f6101707b4
More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents:
21
diff
changeset
|
185 |
MAINSRCS += archivers/grp.c |
49f6101707b4
More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents:
21
diff
changeset
|
186 |
CFLAGS += -DPHYSFS_SUPPORTS_GRP |
49f6101707b4
More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents:
21
diff
changeset
|
187 |
endif |
49f6101707b4
More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents:
21
diff
changeset
|
188 |
|
69
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
189 |
ifeq ($(strip $(cygwin)),true) |
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
190 |
MAINSRCS += platform/win32.c |
74
a4a5066fb640
Compiles and runs on Visual C. What an uphill climb THAT was.
Ryan C. Gordon <icculus@icculus.org>
parents:
71
diff
changeset
|
191 |
CFLAGS += -DWIN32 |
69
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
192 |
else |
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
193 |
MAINSRCS += platform/unix.c |
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
194 |
endif |
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
195 |
|
34 | 196 |
TESTEXE := $(BINDIR)/test_physfs$(EXE_EXT) |
197 |
||
9 | 198 |
# Rule for getting list of objects from source |
199 |
MAINOBJS1 := $(MAINSRCS:.c=.o) |
|
200 |
MAINOBJS2 := $(MAINOBJS1:.cpp=.o) |
|
201 |
MAINOBJS3 := $(MAINOBJS2:.asm=.o) |
|
202 |
MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f)) |
|
203 |
MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f)) |
|
204 |
||
34 | 205 |
TESTOBJS1 := $(TESTSRCS:.c=.o) |
206 |
TESTOBJS2 := $(TESTOBJS1:.cpp=.o) |
|
207 |
TESTOBJS3 := $(TESTOBJS2:.asm=.o) |
|
208 |
TESTOBJS := $(foreach f,$(TESTOBJS3),$(BINDIR)/$(f)) |
|
209 |
TESTSRCS := $(foreach f,$(TESTSRCS),$(SRCDIR)/$(f)) |
|
210 |
||
9 | 211 |
CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \ |
212 |
$(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \ |
|
213 |
$(wildcard *~) $(wildcard *.err) \ |
|
214 |
$(wildcard .\#*) core |
|
215 |
||
216 |
||
217 |
#-----------------------------------------------------------------------------# |
|
218 |
# Rules. |
|
219 |
#-----------------------------------------------------------------------------# |
|
220 |
||
221 |
# Rules for turning source files into .o files |
|
222 |
$(BINDIR)/%.o: $(SRCDIR)/%.cpp |
|
223 |
$(CC) -c -o $@ $< $(CFLAGS) |
|
224 |
||
225 |
$(BINDIR)/%.o: $(SRCDIR)/%.c |
|
226 |
$(CC) -c -o $@ $< $(CFLAGS) |
|
227 |
||
228 |
$(BINDIR)/%.o: $(SRCDIR)/%.asm |
|
229 |
$(ASM) $(ASMFLAGS) -o $@ $< |
|
230 |
||
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
231 |
.PHONY: all clean distclean listobjs install |
9 | 232 |
|
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
233 |
all: $(BINDIR) $(EXTRABUILD) $(MAINLIB) $(TESTEXE) |
9 | 234 |
|
235 |
$(MAINLIB) : $(BINDIR) $(MAINOBJS) |
|
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
236 |
$(LINKER) -o $(MAINLIB) $(SHAREDFLAGS) $(MAINOBJS) $(LDFLAGS) |
34 | 237 |
|
238 |
$(TESTEXE) : $(MAINLIB) $(TESTOBJS) |
|
125 | 239 |
$(LINKER) -o $(TESTEXE) $(TESTOBJS) -L$(BINDIR) -l$(strip $(PUREBASELIBNAME)) $(LDFLAGS) $(TESTLDFLAGS) |
34 | 240 |
|
9 | 241 |
|
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
242 |
install: all |
96
85df1b534b9d
make install deletes previous versions of the library.
Ryan C. Gordon <icculus@icculus.org>
parents:
86
diff
changeset
|
243 |
rm -f $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)).$(strip $(VERMINOR)).* |
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
244 |
mkdir -p $(install_prefix)/bin |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
245 |
mkdir -p $(install_prefix)/lib |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
246 |
mkdir -p $(install_prefix)/include |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
247 |
cp $(SRCDIR)/physfs.h $(install_prefix)/include |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
248 |
cp $(TESTEXE) $(install_prefix)/bin |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
249 |
ifeq ($(strip $(cygwin)),true) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
250 |
cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
251 |
else |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
252 |
cp $(MAINLIB) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
253 |
ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
254 |
ln -sf $(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERMAJOR)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
255 |
chmod 0755 $(install_prefix)/lib/$(strip $(BASELIBNAME))$(strip $(LIB_EXT)).$(strip $(VERFULL)) |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
256 |
chmod 0644 $(install_prefix)/include/physfs.h |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
257 |
endif |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
258 |
|
9 | 259 |
$(BINDIR): |
260 |
mkdir -p $(BINDIR) |
|
20
efdde0d21521
Implementation compiles and links with no actual archive support. No test
Ryan C. Gordon <icculus@icculus.org>
parents:
18
diff
changeset
|
261 |
mkdir -p $(BINDIR)/archivers |
18 | 262 |
mkdir -p $(BINDIR)/platform |
34 | 263 |
mkdir -p $(BINDIR)/test |
9 | 264 |
|
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
265 |
|
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
266 |
ifeq ($(strip $(cygwin)),true) |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
267 |
zlibwin32/zlib.a: |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
268 |
cd zlibwin32 ; $(MAKE) CC=$(CC) |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
269 |
endif |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
270 |
|
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
271 |
|
11
677e01f5109e
Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents:
9
diff
changeset
|
272 |
distclean: clean |
677e01f5109e
Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents:
9
diff
changeset
|
273 |
|
9 | 274 |
clean: |
275 |
rm -f $(CLEANUP) |
|
276 |
rm -rf $(BINDIR) |
|
86
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
277 |
ifeq ($(strip $(cygwin)),true) |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
278 |
cd zlibwin32 ; $(MAKE) clean |
934663982ca9
A little more Cygwin-friendly.
Ryan C. Gordon <icculus@icculus.org>
parents:
81
diff
changeset
|
279 |
endif |
9 | 280 |
|
281 |
listobjs: |
|
282 |
@echo SOURCES: |
|
283 |
@echo $(MAINSRCS) |
|
284 |
@echo |
|
285 |
@echo OBJECTS: |
|
286 |
@echo $(MAINOBJS) |
|
287 |
@echo |
|
288 |
@echo BINARIES: |
|
289 |
@echo $(MAINLIB) |
|
290 |
||
291 |
showcfg: |
|
292 |
@echo "Using CygWin : $(cygwin)" |
|
293 |
@echo "Debugging : $(debugging)" |
|
294 |
@echo "ASM flag : $(use_asm)" |
|
295 |
@echo "Building DLLs : $(build_dll)" |
|
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
296 |
@echo "Install prefix : $(install_prefix)" |
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
297 |
@echo "PhysFS version : $(VERFULL)" |
69
546a95cc5591
Updates, corrections and enhancements to get this ported to win32.
Ryan C. Gordon <icculus@icculus.org>
parents:
60
diff
changeset
|
298 |
@echo "Supports .GRP : $(use_archive_grp)" |
9 | 299 |
@echo "Supports .ZIP : $(use_archive_zip)" |
300 |
||
301 |
#-----------------------------------------------------------------------------# |
|
302 |
# This section is pretty much just for Ryan's use to make distributions. |
|
303 |
# You Probably Should Not Touch. |
|
304 |
#-----------------------------------------------------------------------------# |
|
305 |
||
306 |
# These are the files needed in a binary distribution, regardless of what |
|
307 |
# platform is being used. |
|
308 |
BINSCOMMON := LICENSE.TXT physfs.h |
|
309 |
||
310 |
.PHONY: package msbins win32bins nocygwin |
|
311 |
package: clean |
|
58
3b48a08a4892
Versioning stuff, install rule added.
Ryan C. Gordon <icculus@icculus.org>
parents:
56
diff
changeset
|
312 |
cd .. ; mv physfs physfs-$(VERFULL) ; tar -cyvvf ./physfs-$(VERFULL).tar.bz2 --exclude="*CVS*" physfs-$(VERFULL) ; mv physfs-$(VERFULL) physfs |
9 | 313 |
|
314 |
||
315 |
ifeq ($(strip $(cygwin)),true) |
|
316 |
msbins: win32bins |
|
317 |
||
318 |
win32bins: clean all |
|
60
e5aade8e1b3f
Added appropriate make install target.
Ryan C. Gordon <icculus@icculus.org>
parents:
58
diff
changeset
|
319 |
echo -e "\r\n\r\n\r\nHEY YOU.\r\n\r\n\r\nTake a look at README-win32bins.txt FIRST.\r\n\r\n\r\n--ryan. (icculus@clutteredmind.org)\r\n\r\n" |zip -9rz ../physfs-win32bins-$(shell date +%m%d%Y).zip $(MAINLIB) $(EXTRAPACKAGELIBS) README-win32bins.txt |
9 | 320 |
|
321 |
else |
|
322 |
||
323 |
msbins: nocygwin |
|
324 |
win32bins: nocygwin |
|
325 |
||
326 |
nocygwin: |
|
327 |
@echo This must be done on a Windows box in the Cygwin environment. |
|
328 |
||
329 |
endif |
|
330 |
||
331 |
#-----------------------------------------------------------------------------# |
|
332 |
# That's all, folks. |
|
333 |
#-----------------------------------------------------------------------------# |
|
334 |
||
335 |
# end of Makefile ... |