diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2024-10-02 20:37:29 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2024-10-02 20:37:29 -0400 |
commit | 71eecf3849a47173247a083ff4a14c73bb509c89 (patch) | |
tree | 683b2e50194882b41d82851ee784fa2c9f34a422 /Makefile | |
parent | 19d9a04e36e7fb96eebe89e24311408460c29a70 (diff) |
uh-oh I'm learning zig
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2,12 +2,12 @@ CXXFLAGS := -m32 -ggdb -g3 -O1 -fno-pic -fno-rtti -fno-exceptions -std=c++23 \ -Wall -Wextra -pedantic -Werror LDFLAGS := $(CXXFLAGS) -T link.ld -static -nostdlib -fno-use-cxa-atexit -CXXFILES := $(wildcard src/*.cpp) +CXXFILES := $(wildcard src/*.cpp) $(wildcard src/*.zig) PROJECT := myos PRJISO := $(PROJECT).iso PRJBIN := $(PROJECT).bin -OBJS := $(patsubst src/%.cpp,out/%.o,$(CXXFILES)) +OBJS := $(patsubst src/%.cpp,out/%.o,$(patsubst src/%.zig,out/%.o,$(CXXFILES))) all: $(PRJISO) @@ -26,6 +26,11 @@ out/%.o: src/%.cpp @echo " CXX " $< @g++ $(CXXFLAGS) -c $< -o $@ +out/%.o: src/%.zig + @echo " ZIG " $< + @zig build-obj -target x86-freestanding -O ReleaseSmall $< + @mv $(patsubst src/%.zig,%.o,$<)* out/ + clean: @echo " CLEAN" @rm -f $(OBJS) $(PRJBIN) $(PRJISO) |