summaryrefslogtreecommitdiff
path: root/build/exe.mk
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2008-09-14 19:59:52 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2008-09-14 19:59:52 +0000
commitc10f978fa6ff60c859a46989cd0012b01f9e9626 (patch)
treeac1eb7b7fe2e2cc6b15493bd5c0d8e8fbb31d19b /build/exe.mk
parent02da5ace60e640a90dabff9a4cb024a3d87375f4 (diff)
downloadflac-c10f978fa6ff60c859a46989cd0012b01f9e9626.tar.gz
update Makefile.lite system to work on x86_64 linux
Diffstat (limited to 'build/exe.mk')
-rw-r--r--build/exe.mk38
1 files changed, 13 insertions, 25 deletions
diff --git a/build/exe.mk b/build/exe.mk
index 65a1987f..b9c1c01a 100644
--- a/build/exe.mk
+++ b/build/exe.mk
@@ -21,7 +21,7 @@
include $(topdir)/build/config.mk
-ifeq ($(DARWIN_BUILD),yes)
+ifeq ($(OS),Darwin)
CC = cc
CCC = c++
else
@@ -47,8 +47,12 @@ release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -D
LFLAGS = -L$(LIBPATH)
-DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp=%.debug.o) $(SRCS_NASM:%.nasm=%.debug.o)
-RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o)
+DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp=%.debug.o) $(SRCS_NASM:%.nasm=%.debug.o) $(SRCS_S:%.s=%.debug.o)
+RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o) $(SRCS_S:%.s=%.release.o)
+ifeq ($(PROC),x86_64)
+DEBUG_PIC_OBJS = $(SRCS_C:%.c=%.debug.pic.o) $(SRCS_CC:%.cc=%.debug.pic.o) $(SRCS_CPP:%.cpp=%.debug.pic.o) $(SRCS_NASM:%.nasm=%.debug.pic.o) $(SRCS_S:%.s=%.debug.pic.o)
+RELEASE_PIC_OBJS = $(SRCS_C:%.c=%.release.pic.o) $(SRCS_CC:%.cc=%.release.pic.o) $(SRCS_CPP:%.cpp=%.release.pic.o) $(SRCS_NASM:%.nasm=%.release.pic.o) $(SRCS_S:%.s=%.release.pic.o)
+endif
debug : $(DEBUG_PROGRAM)
valgrind: $(DEBUG_PROGRAM)
@@ -56,41 +60,25 @@ release : $(RELEASE_PROGRAM)
# by default on OS X we link with static libs as much as possible
-$(DEBUG_PROGRAM) : $(DEBUG_OBJS)
-ifeq ($(DARWIN_BUILD),yes)
+$(DEBUG_PROGRAM) : $(DEBUG_OBJS) $(DEBUG_PIC_OBJS)
+ifeq ($(OS),Darwin)
$(LINK) -o $@ $(DEBUG_OBJS) $(EXPLICIT_LIBS)
else
$(LINK) -o $@ $(DEBUG_OBJS) $(LFLAGS) $(LIBS)
endif
-$(RELEASE_PROGRAM) : $(RELEASE_OBJS)
-ifeq ($(DARWIN_BUILD),yes)
+$(RELEASE_PROGRAM) : $(RELEASE_OBJS) $(RELEASE_PIC_OBJS)
+ifeq ($(OS),Darwin)
$(LINK) -o $@ $(RELEASE_OBJS) $(EXPLICIT_LIBS)
else
$(LINK) -o $@ $(RELEASE_OBJS) $(LFLAGS) $(LIBS)
endif
-%.debug.o %.release.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
-%.debug.o %.release.o : %.cc
- $(CCC) $(CFLAGS) -c $< -o $@
-%.debug.o %.release.o : %.cpp
- $(CCC) $(CFLAGS) -c $< -o $@
-%.debug.i %.release.i : %.c
- $(CC) $(CFLAGS) -E $< -o $@
-%.debug.i %.release.i : %.cc
- $(CCC) $(CFLAGS) -E $< -o $@
-%.debug.i %.release.i : %.cpp
- $(CCC) $(CFLAGS) -E $< -o $@
-
-%.debug.o : %.nasm
- $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ -g $< -o $@
-%.release.o : %.nasm
- $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ $< -o $@
+include $(topdir)/build/compile.mk
.PHONY : clean
clean :
- -rm -f $(DEBUG_OBJS) $(RELEASE_OBJS) $(OBJPATH)/*/bin/$(PROGRAM_NAME)
+ -rm -f $(DEBUG_OBJS) $(RELEASE_OBJS) $(DEBUG_PIC_OBJS) $(RELEASE_PIC_OBJS) $(OBJPATH)/*/bin/$(PROGRAM_NAME)
.PHONY : depend
depend: