what about when I compile my own program? .. I should have asked that too with my previous question.
you just make a makefile. Here is one I use:
[makefile]
TARGET = name.elf
OBJS = charbmp.o gfx.o
all: rm-elf $(TARGET)
include $(KOS_BASE)/Makefile.rules
#KOS_CFLAGS += -o3 -fstrict-aliasing -fomit-frame-pointer -ffunction-sections
clean:
-rm -f $(TARGET) $(OBJS) romdisk.*
rm-elf:
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
$(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lSDL_image -lSDL_mixer -lSDL -lpng -ljpeg -ltremor -lz -lm -lk++ $(KOS_LIBS)
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
romdisk.o: romdisk.img
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
run: $(TARGET)
$(KOS_LOADER) $(TARGET)
TARGET = name.elf (Here you can name the .elf whatever you want).
OBJS = charbmp.o gfx.o (Here is the object files that come from the compiler. Whatever '.c' , '.cpp' you use you add it here and replace the .c and .cpp with a .o .
-L$(KOS_BASE)/lib -lSDL_image -lSDL_mixer -lSDL -lpng -ljpeg -ltremor -lz -lm -lk++ $(KOS_LIBS) (Here is where the libs go)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks