now use fpc
This commit is contained in:
24
fpc/Makefile
24
fpc/Makefile
@@ -1,19 +1,25 @@
|
||||
TIER0_FILES := $(wildcard ../tier0/*.cpp)
|
||||
TIER1_FILES := $(wildcard ../tier1/*.cpp)
|
||||
TIER_FILES := ../tier0/lib.cpp ../tier0/mem.cpp ../tier0/platform.cpp ../tier1/utlbuffer.cpp ../tier1/utlstring.cpp ../tier1/utlvector.cpp ../tier1/utlmap.cpp ../tier1/commandline.cpp
|
||||
FPC_FILES := main.cpp library/runner.cpp library/helper.cpp library/c.cpp library/ld.cpp
|
||||
CC = clang
|
||||
OUTPUT_DIR = fpc
|
||||
|
||||
recompile:
|
||||
recompile: ../build/tools
|
||||
./fpc build
|
||||
mv fpc_temp fpc
|
||||
cp fpc ../build/tools/fpc
|
||||
|
||||
install: $(FPC_FILES) ../build/tools
|
||||
$(CC) -g -rdynamic $(TIER_FILES) $(FPC_FILES) -I../public -Ipublic -lc -lstdc++ -o $(OUTPUT_DIR)
|
||||
./fpc build
|
||||
mv fpc_temp fpc
|
||||
|
||||
|
||||
../build/tools:
|
||||
mkdir -p ../build/tools
|
||||
|
||||
install: $(TIER0_FILES) $(TIER1_FILES) $(FPC_FILES) ../build/tools
|
||||
$(CC) -g -rdynamic $(TIER0_FILES) $(TIER1_FILES) $(FPC_FILES) -I../public -Ipublic -lc -lstdc++ -o $(OUTPUT_DIR)
|
||||
./fpc build
|
||||
mv fpc_temp fpc
|
||||
cp fpc ../build/tools/fpc
|
||||
install_fpc:
|
||||
cp fpc ../build/tools
|
||||
cp -r public ../build/tools
|
||||
cp -r ../public/tier0 ../build/tools/public
|
||||
cp -r ../public/tier1 ../build/tools/public
|
||||
|
||||
auto: install install_fpc
|
||||
|
||||
@@ -25,7 +25,10 @@ CUtlString CLDProject::Link( void )
|
||||
{
|
||||
CUtlVector<CUtlString> args = {
|
||||
"rcs",
|
||||
szOutputFile
|
||||
};
|
||||
for (auto object: objects)
|
||||
args.AppendTail(object.m_szObjectFile);
|
||||
IRunner::Run("ar", args);
|
||||
} else {
|
||||
CUtlVector<CUtlString> args = {
|
||||
|
||||
@@ -28,6 +28,25 @@ int IRunner::Run(CUtlString szName, CUtlVector<CUtlString>& args)
|
||||
|
||||
int IRunner::Run(CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
if (pid < 0)
|
||||
Plat_FatalErrorFunc("Failed to fork");
|
||||
/* child */
|
||||
if (pid == 0)
|
||||
{
|
||||
CUtlVector<const char*> execargs;
|
||||
execargs.AppendTail(szName);
|
||||
for (auto &arg: args)
|
||||
{
|
||||
execargs.AppendTail(arg);
|
||||
}
|
||||
execargs.AppendTail(0);
|
||||
chdir(szDirectory.GetString());
|
||||
execvp(szName, (char *const*)execargs.GetData());
|
||||
}
|
||||
/* parent */
|
||||
wait(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IRunner::Run(CUtlString szName, CUtlString szDirectory, CUtlVector<CUtlString>& args, CUtlVector<CUtlString>& environment)
|
||||
|
||||
Reference in New Issue
Block a user