osx/Makefile
changeset 171 c6e0af68825a
parent 168 dfb60716880c
child 172 43ae72f88d06
equal deleted inserted replaced
170:5a11538e7bc8 171:c6e0af68825a
     1       CC = gcc -g -ggdb
     1       CC = gcc -g -ggdb
     2       LD = ld
     2       LD = ld
     3 	ARCH = -arch i386
     3 	ARCH = -arch i386
     4   CFLAGS = -Wall -O2 -Iinclude
     4   CFLAGS = -Wall -O2 -Iinclude
     5  LDFLAGS = $(ARCH)
     5  LDFLAGS = $(ARCH) -Wl,-no_pie
     6     NASM = /usr/local/bin/nasm -f macho -Iinclude/
     6     NASM = nasm -f macho32 -Iinclude -g
     7 
     7 
     8   TARGETS = helloASM
     8   TARGETS = helloASM
     9   #TARGETS+= helloC
     9   TARGETS+= helloC
    10 
    10 
    11 OBJECTS  = hello.o main.o
    11 OBJECTS  = hello.o main.o
    12 ENTRYPOINT = entryPoint
    12 ENTRYPOINT = _entryPoint
    13 
    13 
    14 .SUFFIXES: .c .asm
    14 .SUFFIXES: .c .asm
    15 
    15 
    16 .c.o:
    16 .c.o:
    17 	@echo Compiling $< ...
    17 	@echo Compiling $< ...
    23 
    23 
    24 all: $(TARGETS)
    24 all: $(TARGETS)
    25 
    25 
    26 helloC: $(OBJECTS)
    26 helloC: $(OBJECTS)
    27 	@echo Linking $(OBJECTS) ...
    27 	@echo Linking $(OBJECTS) ...
    28 	$(CC) $(LDFLAGS) $(OBJECTS) -e $(ENTRYPOINT) -o $@
    28 	$(CC) $(LDFLAGS) $(OBJECTS) -o $@
    29 
    29 
    30 helloASM: hello.o
    30 helloASM: hello.o
    31 	@echo Linking $(OBJECTS) ...
    31 	@echo Linking $(OBJECTS) ...
    32 	$(LD) -static -e $(ENTRYPOINT) $< -o $@
    32 	$(LD) -static -e $(ENTRYPOINT) $< -o $@
    33 
    33