diff options
| author | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2023-12-19 04:01:26 -0500 |
|---|---|---|
| committer | EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> | 2023-12-19 04:01:26 -0500 |
| commit | 8cbb1f649c5ede138ff1df974cfef88582a050b7 (patch) | |
| tree | 38a85abe4cbc27cecd29f36bbadbcba886cc6363 | |
| parent | d286be47997ecfc4038ded9442770d603ce53b30 (diff) | |
did something to the makefile
| -rw-r--r-- | kernel/makefile | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/makefile b/kernel/makefile index ced9659..c1aa57f 100644 --- a/kernel/makefile +++ b/kernel/makefile @@ -1,4 +1,5 @@ # Kernel makefile
+#absolute hell
ifndef GAS
GAS = i686-elf-as
@@ -39,9 +40,9 @@ GASFILES := $(wildcard *.s) CRTBEGIN := $(shell $(CXX) $(CXXFLAGS) -print-file-name=crtbegin.o)
CRTEND := $(shell $(CXX) $(CXXFLAGS) -print-file-name=crtend.o)
-OBJECTS := $(C_SOURCES:.c=.o)
-OBJECTS += ${CPP_SOURCES:.cpp=.o}
-OBJECTS += ${ASMFILES:.asm=.o}
+OBJECTS := $(patsubst %.c,%.o,$(C_SOURCES))
+OBJECTS += $(patsubst %.cpp,%.o,$(CPP_SOURCES))
+OBJECTS += $(patsubst %.asm,%.o,$(ASMFILES))
LINKLST := crti.o
LINKLST += $(CRTBEGIN)
@@ -58,15 +59,16 @@ kernel.bin: ${OBJECTS} $(info [INFO] Linking kernel)
$(CXX) ${LDFLAGS} -o ${PREFIX}/kernel.bin $(LINKLST)
-%.o: %.cpp ${HEADERS}
+%.o: %.cpp
$(info [INFO] Compiling $<)
$(CXX) ${CXXFLAGS} -c $< -o $@
-%.o: %.c $(HEADERS)
+%.o: %.c
+ $(info [INFO] Compiling $<)
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.asm
- $(info [INFO] Assembling assembly)
+ $(info [INFO] Assembling $<)
$(NASM) $< -felf32 -o $@ -g
crti.o:
|
