Subversion Repositories Kolibri OS

Rev

Rev 9758 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. CC = kos32-gcc
  2. LD = kos32-ld
  3.  
  4. CONTRIB_DIR = $(abspath ../../..)
  5. SDK_DIR = $(CONTRIB_DIR)/sdk
  6.  
  7. CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -Wno-pointer-arith
  8. LDFLAGS = -static -S -Tapp-dynamic.lds --image-base 0
  9.  
  10. INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/libstdc++-v3/include
  11. LIBPATH = -L $(SDK_DIR)/lib
  12.  
  13. SOURCES = hello.cpp
  14. OBJECTS =  $(patsubst %.cpp, %.o, $(SOURCES))
  15.  
  16. default: hello
  17.  
  18. hello: $(OBJECTS) Makefile
  19.         $(LD) $(LDFLAGS) $(LIBPATH) --subsystem console -o hello $(OBJECTS) -lstdc++ -lsupc++ -lgcc -lc.dll
  20.         strip -s hello -o hello
  21.         objcopy hello -O binary
  22.  
  23. %.o : %.cpp Makefile $(SOURCES)
  24.         $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
  25.