Merge pull request #79 from jadziamd/main

Support Installed Oscar64 Usage
This commit is contained in:
drmortalwombat 2024-08-11 14:03:59 +02:00 committed by GitHub
commit abb2d7a417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 11 deletions

View File

@ -92,16 +92,16 @@ install: compiler
@$(MKDIR_PARENT) $(DESTDIR)$(bindir) @$(MKDIR_PARENT) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(project_dir)/bin/oscar64 $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(project_dir)/bin/oscar64 $(DESTDIR)$(bindir)
@$(MKDIR_PARENT) $(DESTDIR)$(includedir)/oscar64/{audio,c64,c128,cx16,gfx,nes,opp,plus4,vic20} @$(MKDIR_PARENT) $(DESTDIR)$(includedir)/oscar64/{audio,c64,c128,cx16,gfx,nes,opp,plus4,vic20}
$(INSTALL_DATA) $(project_dir)/include/*.h $(DESTDIR)$(includedir)/oscar64 $(INSTALL_DATA) $(project_dir)/include/*.{h,c} $(DESTDIR)$(includedir)/oscar64
$(INSTALL_DATA) $(project_dir)/include/audio/*.h $(DESTDIR)$(includedir)/oscar64/audio $(INSTALL_DATA) $(project_dir)/include/audio/*.{h,c} $(DESTDIR)$(includedir)/oscar64/audio
$(INSTALL_DATA) $(project_dir)/include/c64/*.h $(DESTDIR)$(includedir)/oscar64/c64 $(INSTALL_DATA) $(project_dir)/include/c64/*.{h,c} $(DESTDIR)$(includedir)/oscar64/c64
$(INSTALL_DATA) $(project_dir)/include/c128/*.h $(DESTDIR)$(includedir)/oscar64/c128 $(INSTALL_DATA) $(project_dir)/include/c128/*.{h,c} $(DESTDIR)$(includedir)/oscar64/c128
$(INSTALL_DATA) $(project_dir)/include/cx16/*.h $(DESTDIR)$(includedir)/oscar64/cx16 $(INSTALL_DATA) $(project_dir)/include/cx16/*.{h,c} $(DESTDIR)$(includedir)/oscar64/cx16
$(INSTALL_DATA) $(project_dir)/include/gfx/*.h $(DESTDIR)$(includedir)/oscar64/gfx $(INSTALL_DATA) $(project_dir)/include/gfx/*.{h,c} $(DESTDIR)$(includedir)/oscar64/gfx
$(INSTALL_DATA) $(project_dir)/include/nes/*.h $(DESTDIR)$(includedir)/oscar64/nes $(INSTALL_DATA) $(project_dir)/include/nes/*.{h,c} $(DESTDIR)$(includedir)/oscar64/nes
$(INSTALL_DATA) $(project_dir)/include/opp/*.h $(DESTDIR)$(includedir)/oscar64/opp $(INSTALL_DATA) $(project_dir)/include/opp/*.{h,cpp} $(DESTDIR)$(includedir)/oscar64/opp
$(INSTALL_DATA) $(project_dir)/include/plus4/*.h $(DESTDIR)$(includedir)/oscar64/plus4 $(INSTALL_DATA) $(project_dir)/include/plus4/*.{h,c} $(DESTDIR)$(includedir)/oscar64/plus4
$(INSTALL_DATA) $(project_dir)/include/vic20/*.h $(DESTDIR)$(includedir)/oscar64/vic20 $(INSTALL_DATA) $(project_dir)/include/vic20/*.{h,c} $(DESTDIR)$(includedir)/oscar64/vic20
uninstall: uninstall:

View File

@ -113,7 +113,30 @@ int main2(int argc, const char** argv)
compiler->mPreprocessor->AddPath(basePath); compiler->mPreprocessor->AddPath(basePath);
strcpy_s(includePath, basePath); strcpy_s(includePath, basePath);
{
FILE* crtFile;
char crtFileNamePath[FILENAME_MAX];
crtFileNamePath[FILENAME_MAX - 1] = '\0';
strcpy_s(crtFileNamePath, basePath);
strcat_s(crtFileNamePath, "include/crt.h");
if ((crtFile = fopen(crtFileNamePath, "r")))
strcat_s(includePath, "include/"); strcat_s(includePath, "include/");
else
{
strcpy_s(crtFileNamePath, basePath);
strcat_s(crtFileNamePath, "include/oscar64/crt.h");
if ((crtFile = fopen(crtFileNamePath, "r")))
strcat_s(includePath, "include/oscar64/");
else
{
printf("Could not locate Oscar64 includes under %s\n", basePath);
return 20;
}
}
fclose(crtFile);
}
compiler->mPreprocessor->AddPath(includePath); compiler->mPreprocessor->AddPath(includePath);
strcpy_s(crtPath, includePath); strcpy_s(crtPath, includePath);
strcat_s(crtPath, "crt.c"); strcat_s(crtPath, "crt.c");