Makefile
author Ryan C. Gordon <icculus@icculus.org>
Sun, 08 Jul 2001 13:57:28 +0000
changeset 23 bd6ba9c8717c
parent 22 49f6101707b4
child 34 86c247b7be8d
permissions -rw-r--r--
Initial debugging: dropped PhysicsFS routines into the Build engine, replacing Ken's groupfile management. Not finished, but lots of initial debugging is complete. More bugs, likely in OUR groupfile code, are waiting to be fixed, but the KenBuild editor runs without crashing (er...but the palette doesn't seem to be loading... :) ) --ryan.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
# PhysicsFS -- A filesystem abstraction.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
#  Please see the file LICENSE in the source's root directory.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
#   This file written by Ryan C. Gordon.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
# Makefile for building PhysicsFS on Unix-like systems. Follow the
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
#  instructions for editing this file, then run "make" on the command line.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
# Set to your liking.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
CC = gcc
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
LINKER = gcc
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
# If this makefile fails to detect Cygwin correctly, or you want to force
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
#  the build process's behaviour, set it to "true" or "false" (w/o quotes).
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
#cygwin := true
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
#cygwin := false
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
cygwin := autodetect
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
# Set this to true if you want to create a debug build.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
#debugging := false
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
debugging := true
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
# Set the archive types you'd like to support.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
#  Note that various archives may need external libraries.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
use_archive_zip := false
21
b1ea58d70a56 Archive implementation (Build Groupfiles), other tweaks.
Ryan C. Gordon <icculus@icculus.org>
parents: 20
diff changeset
    41
use_archive_grp := true
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
# Set to "true" if you'd like to build a DLL. Set to "false" otherwise.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
#build_dll := false
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
build_dll := true
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
# Set one of the below. Currently, none of these are used.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
#use_asm = -DUSE_I386_ASM
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
use_asm = -DUSE_PORTABLE_C
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
# Everything below this line is probably okay.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
# CygWin autodetect.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
ifeq ($(strip $(cygwin)),autodetect)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
  ifneq ($(strip $(shell gcc -v 2>&1 |grep "cygwin")),)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
    cygwin := true
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
  else
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
    cygwin := false
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
  endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    80
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    81
# Platform-specific binary stuff.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
ifeq ($(strip $(cygwin)),true)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
  # !!! FIXME
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
  build_dll := false
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
  # !!! FIXME
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
  ASM = nasmw
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
  EXE_EXT = .exe
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
  DLL_EXT = .dll
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
  STATICLIB_EXT = .a
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
  ASMOBJFMT = win32
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
  ASMDEFS = -dC_IDENTIFIERS_UNDERSCORED
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
  CFLAGS += -DC_IDENTIFIERS_UNDERSCORED
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
else
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
  ASM = nasm
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
  EXE_EXT =
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
  DLL_EXT = .so
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
  STATICLIB_EXT = .a
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
  ASMOBJFMT = elf
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
ifeq ($(strip $(build_dll)),true)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
LIB_EXT := $(DLL_EXT)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
LDFLAGS += -shared
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
else
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
LIB_EXT := $(STATICLIB_EXT)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
# General compiler, assembler, and linker flags.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
BINDIR := bin
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
SRCDIR := .
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
CFLAGS += $(use_asm) -I$(SRCDIR) -D_REENTRANT -fsigned-char -DPLATFORM_UNIX
13
4f98eb8bbabb fixed typo
Ryan C. Gordon <icculus@icculus.org>
parents: 11
diff changeset
   119
CFLAGS += -Wall -Werror -fno-exceptions -fno-rtti -ansi -pedantic
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
LDFLAGS += -lm
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
ifeq ($(strip $(debugging)),true)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
  CFLAGS += -DDEBUG -g -fno-omit-frame-pointer
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
  LDFLAGS += -g -fno-omit-frame-pointer
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
else
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
  CFLAGS += -DNDEBUG -O2 -fomit-frame-pointer
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
  LDFLAGS += -O2 -fomit-frame-pointer
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
ASMFLAGS := -f $(ASMOBJFMT) $(ASMDEFS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
# Source and target names.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
BASELIBNAME := physfs
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
18
bb03dd217a97 Changes for subdirs.
Ryan C. Gordon <icculus@icculus.org>
parents: 13
diff changeset
   141
MAINSRCS := physfs.c platform/unix.c archivers/dir.c
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
ifeq ($(strip $(use_archive_zip)),true)
18
bb03dd217a97 Changes for subdirs.
Ryan C. Gordon <icculus@icculus.org>
parents: 13
diff changeset
   144
MAINSRCS += archivers/zip.c
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
CFLAGS += -DPHYSFS_SUPPORTS_ZIP
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
22
49f6101707b4 More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
   148
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
   149
MAINSRCS += archivers/grp.c
49f6101707b4 More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
   150
CFLAGS += -DPHYSFS_SUPPORTS_GRP
49f6101707b4 More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
   151
endif
49f6101707b4 More tweaks; GRP completely implemented. Everything builds clean.
Ryan C. Gordon <icculus@icculus.org>
parents: 21
diff changeset
   152
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
# Rule for getting list of objects from source
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
MAINOBJS1 := $(MAINSRCS:.c=.o)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
MAINOBJS2 := $(MAINOBJS1:.cpp=.o)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
MAINOBJS3 := $(MAINOBJS2:.asm=.o)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f))
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f))
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
          $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
          $(wildcard *~) $(wildcard *.err) \
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
          $(wildcard .\#*) core
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
# Rules.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
# Rules for turning source files into .o files
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
$(BINDIR)/%.o: $(SRCDIR)/%.cpp
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
	$(CC) -c -o $@ $< $(CFLAGS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
$(BINDIR)/%.o: $(SRCDIR)/%.c
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
	$(CC) -c -o $@ $< $(CFLAGS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
$(BINDIR)/%.o: $(SRCDIR)/%.asm
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
	$(ASM) $(ASMFLAGS) -o $@ $<
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
11
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 9
diff changeset
   181
.PHONY: all clean distclean listobjs
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
all: $(BINDIR) $(MAINLIB)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
$(MAINLIB) : $(BINDIR) $(MAINOBJS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
	$(LINKER) -o $(MAINLIB) $(LDFLAGS) $(MAINOBJS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
$(BINDIR):
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
	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
   190
	mkdir -p $(BINDIR)/archivers
18
bb03dd217a97 Changes for subdirs.
Ryan C. Gordon <icculus@icculus.org>
parents: 13
diff changeset
   191
	mkdir -p $(BINDIR)/platform
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
11
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 9
diff changeset
   193
distclean: clean
677e01f5109e Progress toward complete implementation continues...
Ryan C. Gordon <icculus@icculus.org>
parents: 9
diff changeset
   194
9
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
clean:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
	rm -f $(CLEANUP)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
	rm -rf $(BINDIR)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
listobjs:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
	@echo SOURCES:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
	@echo $(MAINSRCS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
	@echo
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
	@echo OBJECTS:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
	@echo $(MAINOBJS)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
	@echo
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
	@echo BINARIES:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
	@echo $(MAINLIB)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
showcfg:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
	@echo "Using CygWin   : $(cygwin)"
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
	@echo "Debugging      : $(debugging)"
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
	@echo "ASM flag       : $(use_asm)"
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
	@echo "Building DLLs  : $(build_dll)"
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
	@echo "Supports .ZIP  : $(use_archive_zip)"
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
# This section is pretty much just for Ryan's use to make distributions.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
#  You Probably Should Not Touch.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   220
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   221
# These are the files needed in a binary distribution, regardless of what
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
#  platform is being used.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   223
BINSCOMMON := LICENSE.TXT physfs.h
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
.PHONY: package msbins win32bins nocygwin
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
package: clean
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   227
	cd .. ; zip -9rz ./physfs-src-$(shell date +%m%d%Y).zip physfs -x "*CVS*" < physfs/FILEID.DIZ
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
ifeq ($(strip $(cygwin)),true)
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   231
msbins: win32bins
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
win32bins: clean all
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   234
	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@linuxgames.com)\r\n\r\n" |zip -9rz ../physfs-win32bins-$(shell date +%m%d%Y).zip $(MAINLIB) $(EXTRAPACKAGELIBS) README-win32bins.txt
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   235
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   236
else
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   237
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   238
msbins: nocygwin
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   239
win32bins: nocygwin
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   240
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
nocygwin:
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
	@echo This must be done on a Windows box in the Cygwin environment.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
endif
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
# That's all, folks.
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   248
#-----------------------------------------------------------------------------#
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   249
1155788ccbe3 Initial add. Ways to go.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   250
# end of Makefile ...