Browse Source

gcc -> g++

master
pedroBzh 2 months ago
parent
commit
c6b70ddbe1
2 changed files with 16 additions and 14 deletions
  1. +12
    -12
      Makefile
  2. +4
    -2
      src/main.c

+ 12
- 12
Makefile View File

@ -41,10 +41,10 @@ FXCONVFX := --fx --toolchain=$(TOOLCHAIN_FX)
FXCONVCG := --cg --toolchain=$(TOOLCHAIN_CG)
# Determine the compiler install and include path
GCC_BASE_FX := $(shell $(TOOLCHAIN_FX)-gcc --print-search-dirs | grep install | sed 's/install: //')
GCC_BASE_CG := $(shell $(TOOLCHAIN_CG)-gcc --print-search-dirs | grep install | sed 's/install: //')
GCC_INCLUDE_FX := $(GCC_BASE_FX)/include
GCC_INCLUDE_CG := $(GCC_BASE_CG)/include
g++_BASE_FX := $(shell $(TOOLCHAIN_FX)-g++ --print-search-dirs | grep install | sed 's/install: //')
g++_BASE_CG := $(shell $(TOOLCHAIN_CG)-g++ --print-search-dirs | grep install | sed 's/install: //')
g++_INCLUDE_FX := $(g++_BASE_FX)/include
g++_INCLUDE_CG := $(g++_BASE_CG)/include
#
# File listings
@ -105,39 +105,39 @@ all-cg: $(TARGET_CG)
$(TARGET_FX): $(obj-fx) $(deps-fx)
@ mkdir -p $(dir $@)
$(TOOLCHAIN_FX)-gcc -o $(ELF_FX) $(obj-fx) $(CFLAGSFX) $(LDFLAGSFX)
$(TOOLCHAIN_FX)-g++ -o $(ELF_FX) $(obj-fx) $(CFLAGSFX) $(LDFLAGSFX)
$(TOOLCHAIN_FX)-objcopy -O binary $(BINFLAGS) $(ELF_FX) $(BIN_FX)
fxg1a $(BIN_FX) -o $@ $(G1AF)
$(TARGET_CG): $(obj-cg) $(deps-cg)
@ mkdir -p $(dir $@)
$(TOOLCHAIN_CG)-gcc -o $(ELF_CG) $(obj-cg) $(CFLAGSCG) $(LDFLAGSCG)
$(TOOLCHAIN_CG)-g++ -o $(ELF_CG) $(obj-cg) $(CFLAGSCG) $(LDFLAGSCG)
$(TOOLCHAIN_CG)-objcopy -O binary $(BINFLAGS) $(ELF_CG) $(BIN_CG)
mkg3a $(G3AF) $(BIN_CG) $@
# C sources
build-fx/%.c.o: %.c
@ mkdir -p $(dir $@)
$(TOOLCHAIN_FX)-gcc -c $< -o $@ $(CFLAGSFX) $(depflags)
$(TOOLCHAIN_FX)-g++ -c $< -o $@ $(CFLAGSFX) $(depflags)
build-cg/%.c.o: %.c
@ mkdir -p $(dir $@)
$(TOOLCHAIN_CG)-gcc -c $< -o $@ $(CFLAGSCG) $(depflags)
$(TOOLCHAIN_CG)-g++ -c $< -o $@ $(CFLAGSCG) $(depflags)
# Assembler sources
build-fx/%.s.o: %.s
@ mkdir -p $(dir $@)
$(TOOLCHAIN_FX)-gcc -c $< -o $@
$(TOOLCHAIN_FX)-g++ -c $< -o $@
build-cg/%.s.o: %.s
@ mkdir -p $(dir $@)
$(TOOLCHAIN_CG)-gcc -c $< -o $@
$(TOOLCHAIN_CG)-g++ -c $< -o $@
# Preprocessed assembler sources
build-fx/%.S.o: %.S
@ mkdir -p $(dir $@)
$(TOOLCHAIN_FX)-gcc -c $< -o $@ $(INCLUDE_FX)
$(TOOLCHAIN_FX)-g++ -c $< -o $@ $(INCLUDE_FX)
build-cg/%.S.o: %.S
@ mkdir -p $(dir $@)
$(TOOLCHAIN_CG)-gcc -c $< -o $@ $(INCLUDE_CG)
$(TOOLCHAIN_CG)-g++ -c $< -o $@ $(INCLUDE_CG)
# Images
build-fx/assets/img/%.o: assets-fx/img/%


+ 4
- 2
src/main.c View File

@ -1,5 +1,7 @@
#include <gint/display.h>
#include <gint/keyboard.h>
extern "C"{
#include <gint/display.h>
#include <gint/keyboard.h>
}
int main(void)
{


Loading…
Cancel
Save