mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Changed default to building library archives instead of shared objects.
Added support for compiling *.c files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
739a56d26d
commit
112a72ce80
@ -77,6 +77,7 @@ Depend = $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
|
|||||||
|
|
||||||
# Archive a bunch of .o files into a .a file...
|
# Archive a bunch of .o files into a .a file...
|
||||||
AR = ar cq
|
AR = ar cq
|
||||||
|
MakeLib = $(AR)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
|
||||||
@ -85,7 +86,8 @@ AR = ar cq
|
|||||||
ifndef Source
|
ifndef Source
|
||||||
Source = $(wildcard *.cpp *.c *.y *.l)
|
Source = $(wildcard *.cpp *.c *.y *.l)
|
||||||
endif
|
endif
|
||||||
Objs = $(sort $(addsuffix .o,$(basename $(Source))))
|
|
||||||
|
Objs = $(addsuffix .o,$(basename $(Source)))
|
||||||
ObjectsO = $(addprefix Release/,$(Objs))
|
ObjectsO = $(addprefix Release/,$(Objs))
|
||||||
ObjectsG = $(addprefix Debug/,$(Objs))
|
ObjectsG = $(addprefix Debug/,$(Objs))
|
||||||
|
|
||||||
@ -108,11 +110,13 @@ endif
|
|||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
|
||||||
ifdef LIBRARYNAME
|
ifdef LIBRARYNAME
|
||||||
|
|
||||||
LIBNAME_O := Release/lib$(LIBRARYNAME).so
|
LIBNAME_O := Release/lib$(LIBRARYNAME).so
|
||||||
LIBNAME_G := Debug/lib$(LIBRARYNAME).so
|
LIBNAME_G := Debug/lib$(LIBRARYNAME).so
|
||||||
|
LIBNAME_AO := Release/lib$(LIBRARYNAME).a
|
||||||
|
LIBNAME_AG := Debug/lib$(LIBRARYNAME).a
|
||||||
|
|
||||||
all:: $(LIBNAME_G)
|
all:: $(LIBNAME_AG)
|
||||||
#$(LIBNAME_O)
|
|
||||||
# TODO: Enable optimized builds
|
# TODO: Enable optimized builds
|
||||||
|
|
||||||
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
||||||
@ -123,22 +127,42 @@ $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) Debug/.dir Depend/.dir
|
|||||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||||
$(MakeSOG) -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
$(MakeSOG) -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
||||||
|
|
||||||
|
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
||||||
|
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||||
|
rm -f $@
|
||||||
|
$(MakeLib) $@ $(ObjectsO) $(LibSubDirs)
|
||||||
|
|
||||||
|
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) Debug/.dir Depend/.dir
|
||||||
|
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||||
|
rm -f $@
|
||||||
|
$(MakeLib) $@ $(ObjectsG) $(LibSubDirs)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
|
||||||
# Create dependacies for the cpp files...
|
# Create dependencies for the *.cpp files...
|
||||||
Depend/%.d: %.cpp Depend/.dir
|
Depend/%.d: %.cpp Depend/.dir
|
||||||
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
||||||
|
|
||||||
# Create .o files in the ObjectFiles directory from the .cpp files...
|
# Create dependencies for the *.c files...
|
||||||
|
Depend/%.d: %.c Depend/.dir
|
||||||
|
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
||||||
|
|
||||||
|
# Create .o files in the ObjectFiles directory from the .cpp and .c files...
|
||||||
Release/%.o: %.cpp Release/.dir Depend/.dir
|
Release/%.o: %.cpp Release/.dir Depend/.dir
|
||||||
$(CompileO) $< -o $@
|
$(CompileO) $< -o $@
|
||||||
|
|
||||||
|
Release/%.o: %.c Release/.dir Depend/.dir
|
||||||
|
$(CompileO) $< -o $@
|
||||||
|
|
||||||
Debug/%.o: %.cpp Debug/.dir Depend/.dir
|
Debug/%.o: %.cpp Debug/.dir Depend/.dir
|
||||||
$(CompileG) $< -o $@
|
$(CompileG) $< -o $@
|
||||||
|
|
||||||
|
Debug/%.o: %.c Debug/.dir Depend/.dir
|
||||||
|
$(CompileG) $< -o $@
|
||||||
|
|
||||||
# Create a .cpp source file from a flex input file... this uses sed to cut down
|
# Create a .cpp source file from a flex input file... this uses sed to cut down
|
||||||
# on the warnings emited by GCC...
|
# on the warnings emited by GCC...
|
||||||
%.cpp: %.l
|
%.cpp: %.l
|
||||||
|
@ -77,6 +77,7 @@ Depend = $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
|
|||||||
|
|
||||||
# Archive a bunch of .o files into a .a file...
|
# Archive a bunch of .o files into a .a file...
|
||||||
AR = ar cq
|
AR = ar cq
|
||||||
|
MakeLib = $(AR)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
|
||||||
@ -85,7 +86,8 @@ AR = ar cq
|
|||||||
ifndef Source
|
ifndef Source
|
||||||
Source = $(wildcard *.cpp *.c *.y *.l)
|
Source = $(wildcard *.cpp *.c *.y *.l)
|
||||||
endif
|
endif
|
||||||
Objs = $(sort $(addsuffix .o,$(basename $(Source))))
|
|
||||||
|
Objs = $(addsuffix .o,$(basename $(Source)))
|
||||||
ObjectsO = $(addprefix Release/,$(Objs))
|
ObjectsO = $(addprefix Release/,$(Objs))
|
||||||
ObjectsG = $(addprefix Debug/,$(Objs))
|
ObjectsG = $(addprefix Debug/,$(Objs))
|
||||||
|
|
||||||
@ -108,11 +110,13 @@ endif
|
|||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
|
||||||
ifdef LIBRARYNAME
|
ifdef LIBRARYNAME
|
||||||
|
|
||||||
LIBNAME_O := Release/lib$(LIBRARYNAME).so
|
LIBNAME_O := Release/lib$(LIBRARYNAME).so
|
||||||
LIBNAME_G := Debug/lib$(LIBRARYNAME).so
|
LIBNAME_G := Debug/lib$(LIBRARYNAME).so
|
||||||
|
LIBNAME_AO := Release/lib$(LIBRARYNAME).a
|
||||||
|
LIBNAME_AG := Debug/lib$(LIBRARYNAME).a
|
||||||
|
|
||||||
all:: $(LIBNAME_G)
|
all:: $(LIBNAME_AG)
|
||||||
#$(LIBNAME_O)
|
|
||||||
# TODO: Enable optimized builds
|
# TODO: Enable optimized builds
|
||||||
|
|
||||||
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
||||||
@ -123,22 +127,42 @@ $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) Debug/.dir Depend/.dir
|
|||||||
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||||
$(MakeSOG) -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
$(MakeSOG) -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
|
||||||
|
|
||||||
|
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) Release/.dir Depend/.dir
|
||||||
|
@echo ======= Linking $(LIBRARYNAME) release library =======
|
||||||
|
rm -f $@
|
||||||
|
$(MakeLib) $@ $(ObjectsO) $(LibSubDirs)
|
||||||
|
|
||||||
|
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) Debug/.dir Depend/.dir
|
||||||
|
@echo ======= Linking $(LIBRARYNAME) debug library =======
|
||||||
|
rm -f $@
|
||||||
|
$(MakeLib) $@ $(ObjectsG) $(LibSubDirs)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
|
||||||
# Create dependacies for the cpp files...
|
# Create dependencies for the *.cpp files...
|
||||||
Depend/%.d: %.cpp Depend/.dir
|
Depend/%.d: %.cpp Depend/.dir
|
||||||
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
||||||
|
|
||||||
# Create .o files in the ObjectFiles directory from the .cpp files...
|
# Create dependencies for the *.c files...
|
||||||
|
Depend/%.d: %.c Depend/.dir
|
||||||
|
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
|
||||||
|
|
||||||
|
# Create .o files in the ObjectFiles directory from the .cpp and .c files...
|
||||||
Release/%.o: %.cpp Release/.dir Depend/.dir
|
Release/%.o: %.cpp Release/.dir Depend/.dir
|
||||||
$(CompileO) $< -o $@
|
$(CompileO) $< -o $@
|
||||||
|
|
||||||
|
Release/%.o: %.c Release/.dir Depend/.dir
|
||||||
|
$(CompileO) $< -o $@
|
||||||
|
|
||||||
Debug/%.o: %.cpp Debug/.dir Depend/.dir
|
Debug/%.o: %.cpp Debug/.dir Depend/.dir
|
||||||
$(CompileG) $< -o $@
|
$(CompileG) $< -o $@
|
||||||
|
|
||||||
|
Debug/%.o: %.c Debug/.dir Depend/.dir
|
||||||
|
$(CompileG) $< -o $@
|
||||||
|
|
||||||
# Create a .cpp source file from a flex input file... this uses sed to cut down
|
# Create a .cpp source file from a flex input file... this uses sed to cut down
|
||||||
# on the warnings emited by GCC...
|
# on the warnings emited by GCC...
|
||||||
%.cpp: %.l
|
%.cpp: %.l
|
||||||
|
Loading…
x
Reference in New Issue
Block a user