src/Makefile.in
author David Anderson <dvander@alliedmods.net>
Sat Nov 17 20:03:57 2012 -0800 (2012-11-17)
changeset 204 ff89b2640fba
parent 86 32ad0523b309
permissions -rw-r--r--
Added missing tests.
     1 #vim: set ft=make: 
     2 
     3 CXX=@CXX@
     4 CXXFLAGS=@CXXFLAGS@
     5 srcdir=@srcdir@
     6 VPATH=${srcdir}
     7 TOOLS=${srcdir}/../build
     8 CXXVENDOR=@CXXVENDOR@
     9 PLATFORM="@PLATFORM@"
    10 NULL =
    11 
    12 INCLUDES += 
    13 CXXFLAGS += $(INCLUDES)
    14 BASECXXFLAGS = -Wall -Werror -Wno-null-arithmetic -Wno-invalid-offsetof -g3 -O0
    15 
    16 CPPSRCS = \
    17 	Array.cpp                  \
    18 	BytecodeCompiler.cpp       \
    19 	BytecodeEmitter.cpp	   \
    20 	CompileContext.cpp         \
    21         Exception.cpp              \
    22         FixedArray.cpp             \
    23         Functions.cpp              \
    24 	Heap.cpp                   \
    25         Interpreter.cpp            \
    26 	Modules.cpp                \
    27 	NameBinding.cpp            \
    28 	Parser.cpp                 \
    29 	Opcodes.cpp                \
    30 	PoolAllocator.cpp          \
    31 	Reference.cpp              \
    32 	RootScopes.cpp             \
    33 	Scanner.cpp                \
    34 	Scopes.cpp                 \
    35 	SemanticAnalysis.cpp       \
    36 	Spaces.cpp                 \
    37 	Stack.cpp                  \
    38 	TypeManager.cpp            \
    39 	Types.cpp                  \
    40 	Zone.cpp                   \
    41 	main.cpp                   \
    42 	$(NULL)
    43 
    44 ifeq ("darwin", $(PLATFORM))
    45 CPPSRCS += \
    46 	Platform-Posix.cpp         \
    47 	$(NULL)
    48 endif
    49 ifeq ("linux", $(PLATFORM))
    50 CPPSRCS += \
    51 	Platform-Posix.cpp         \
    52 	$(NULL)
    53 endif
    54 
    55 default: all
    56 
    57 OBJECTS := $(CPPSRCS:%.cpp=%.o)
    58 
    59 ifeq ($(CXXVENDOR), microsoft)
    60 
    61 CXXFLAGS += /DWIN32 /D_WINDOWS
    62 
    63 %.o: %.cpp
    64 	$(CXX) $(CXXFLAGS) /Fo$@ /c /TP /nologo $<
    65 else
    66 
    67 %.o: %.cpp
    68 	$(CXX) $(BASECXXFLAGS) $(CXXFLAGS) -c -o $@ -Wp,-MD,.deps/$(patsubst %.o,%.d,$@) $<
    69 
    70 endif
    71 
    72 #$(CXX) $(BASECXXFLAGS) $(CXXFLAGS) -c -o $@ -Wp,-MD,.deps/$(basename $(@F)).pp $<
    73 
    74 DEPEND_FILES := $(strip $(wildcard .deps/*.d))
    75 
    76 ifneq (,$(DEPEND_FILES))
    77 DEPEND_RESULTS = $(shell $(TOOLS)/mddepend.pl - $(DEPEND_FILES))
    78 $(eval $(DEPEND_RESULTS))
    79 endif
    80 
    81 all: foobar
    82 
    83 foobar: libfoobar.a main.o
    84 	$(CXX) main.o libfoobar.a -lpthread -o foobar
    85 
    86 libfoobar.a: $(OBJECTS)
    87 	$(AR) -crs libfoobar.a $(OBJECTS)
    88 
    89 FORCE:
    90 
    91 clean:
    92 	rm -f .deps/*.d
    93 	rm -f *.o
    94 	rm -f libfoobar.a
    95 	rm -f foobar
    96