Added test binary.
This commit is contained in:
parent
91ce826b1e
commit
27efd660d9
22
Makefile
22
Makefile
|
@ -103,7 +103,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(strip $(build_dll)),true)
|
ifeq ($(strip $(build_dll)),true)
|
||||||
LIB_EXT := $(DLL_EXT)
|
LIB_EXT := $(DLL_EXT)
|
||||||
LDFLAGS += -shared
|
SHAREDFLAGS += -shared
|
||||||
else
|
else
|
||||||
LIB_EXT := $(STATICLIB_EXT)
|
LIB_EXT := $(STATICLIB_EXT)
|
||||||
endif
|
endif
|
||||||
|
@ -138,6 +138,8 @@ ASMFLAGS := -f $(ASMOBJFMT) $(ASMDEFS)
|
||||||
BASELIBNAME := physfs
|
BASELIBNAME := physfs
|
||||||
MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))
|
MAINLIB := $(BINDIR)/$(strip $(BASELIBNAME))$(strip $(LIB_EXT))
|
||||||
|
|
||||||
|
TESTSRCS := test/test_physfs.c
|
||||||
|
|
||||||
MAINSRCS := physfs.c platform/unix.c archivers/dir.c
|
MAINSRCS := physfs.c platform/unix.c archivers/dir.c
|
||||||
|
|
||||||
ifeq ($(strip $(use_archive_zip)),true)
|
ifeq ($(strip $(use_archive_zip)),true)
|
||||||
|
@ -150,14 +152,21 @@ MAINSRCS += archivers/grp.c
|
||||||
CFLAGS += -DPHYSFS_SUPPORTS_GRP
|
CFLAGS += -DPHYSFS_SUPPORTS_GRP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
TESTEXE := $(BINDIR)/test_physfs$(EXE_EXT)
|
||||||
|
|
||||||
# Rule for getting list of objects from source
|
# Rule for getting list of objects from source
|
||||||
MAINOBJS1 := $(MAINSRCS:.c=.o)
|
MAINOBJS1 := $(MAINSRCS:.c=.o)
|
||||||
MAINOBJS2 := $(MAINOBJS1:.cpp=.o)
|
MAINOBJS2 := $(MAINOBJS1:.cpp=.o)
|
||||||
MAINOBJS3 := $(MAINOBJS2:.asm=.o)
|
MAINOBJS3 := $(MAINOBJS2:.asm=.o)
|
||||||
|
|
||||||
MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f))
|
MAINOBJS := $(foreach f,$(MAINOBJS3),$(BINDIR)/$(f))
|
||||||
MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f))
|
MAINSRCS := $(foreach f,$(MAINSRCS),$(SRCDIR)/$(f))
|
||||||
|
|
||||||
|
TESTOBJS1 := $(TESTSRCS:.c=.o)
|
||||||
|
TESTOBJS2 := $(TESTOBJS1:.cpp=.o)
|
||||||
|
TESTOBJS3 := $(TESTOBJS2:.asm=.o)
|
||||||
|
TESTOBJS := $(foreach f,$(TESTOBJS3),$(BINDIR)/$(f))
|
||||||
|
TESTSRCS := $(foreach f,$(TESTSRCS),$(SRCDIR)/$(f))
|
||||||
|
|
||||||
CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \
|
CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \
|
||||||
$(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
|
$(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
|
||||||
$(wildcard *~) $(wildcard *.err) \
|
$(wildcard *~) $(wildcard *.err) \
|
||||||
|
@ -180,15 +189,20 @@ $(BINDIR)/%.o: $(SRCDIR)/%.asm
|
||||||
|
|
||||||
.PHONY: all clean distclean listobjs
|
.PHONY: all clean distclean listobjs
|
||||||
|
|
||||||
all: $(BINDIR) $(MAINLIB)
|
all: $(BINDIR) $(MAINLIB) $(TESTEXE)
|
||||||
|
|
||||||
$(MAINLIB) : $(BINDIR) $(MAINOBJS)
|
$(MAINLIB) : $(BINDIR) $(MAINOBJS)
|
||||||
$(LINKER) -o $(MAINLIB) $(LDFLAGS) $(MAINOBJS)
|
$(LINKER) -o $(MAINLIB) $(LDFLAGS) $(SHAREDFLAGS) $(MAINOBJS)
|
||||||
|
|
||||||
|
$(TESTEXE) : $(MAINLIB) $(TESTOBJS)
|
||||||
|
$(LINKER) -o $(TESTEXE) $(LDFLAGS) $(TESTOBJS) $(MAINLIB)
|
||||||
|
|
||||||
|
|
||||||
$(BINDIR):
|
$(BINDIR):
|
||||||
mkdir -p $(BINDIR)
|
mkdir -p $(BINDIR)
|
||||||
mkdir -p $(BINDIR)/archivers
|
mkdir -p $(BINDIR)/archivers
|
||||||
mkdir -p $(BINDIR)/platform
|
mkdir -p $(BINDIR)/platform
|
||||||
|
mkdir -p $(BINDIR)/test
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue