25 lines
556 B
Makefile
25 lines
556 B
Makefile
rose_objects = string.o
|
|
objects = main.o
|
|
CFLAGS = -m32 -mgeneral-regs-only -march=i386 -fno-stack-protector -Wno-int-conversion -c -Iinclude
|
|
LFLAGS = -m32
|
|
|
|
all: test
|
|
./test
|
|
|
|
test: $(objects) $(rose_objects)
|
|
clang $(LFLAGS) -o $@ $^
|
|
|
|
%.o: ../%.nasm
|
|
nasm -f elf32 -o $@ $<
|
|
objcopy --prefix-symbols=rose_ $@
|
|
|
|
%.o: %.c
|
|
clang $(CFLAGS) -ffunction-sections -fdata-sections -Os -o $@ $<
|
|
|
|
%.o: ../%.c
|
|
clang $(CFLAGS) -nostdlib -ffunction-sections -fdata-sections -Os -o $@ $<
|
|
objcopy --prefix-symbols=rose_ $@
|
|
|
|
clean:
|
|
rm -f $(objects) $(rose_objects) test
|