freebsd-ports/emulators/osmose/files/patch-Makefile
Alejandro Pulver 5650140fa4 - Add ONLY_FOR_ARCHS_REASON.
- Add USE_DOS2UNIX to avoid CR characters in patches.
- Remove FreeBSD 4.x support.
- Remove SDL fix for old non-standard location.
- Fix building with GCC 4.x [1].
- Respect CFLAGS and LDFLAGS.

Reported by:	pointyhat [1]
2007-04-08 03:11:22 +00:00

54 lines
1.3 KiB
Text

--- Makefile.orig Sat Apr 7 20:42:59 2007
+++ Makefile Sat Apr 7 20:44:04 2007
@@ -43,21 +43,25 @@
# Compiler/Linker Flags
# add -O3 to CFLAGS for speedup -pg on LFLAGS and CFLAGS for gprof
-CFLAGS = -Wall -O3
-LFLAGS = -lSDL
+CFLAGS += -Dlinux `sdl-config --cflags`
+
+ifdef OPTIMIZED_CFLAGS
+CFLAGS += -O3
+endif
+
+LFLAGS = $(LDFLAGS) `sdl-config --libs`
AFLAGS = -f elf
-CC = g++
-C_COMP = gcc
+CXX ?= g++
ASM = nasm
# Our needed rules. $* is current file, without suffix.
.SUFFIXES: .cxx .o
.cxx.o:
- $(CC) $(CFLAGS) -c $*.cxx -o $*.o
+ $(CXX) $(CFLAGS) -c $*.cxx -o $*.o
.SUFFIXES: .cpp .o
.cpp.o:
- $(CC) $(CFLAGS) -c $*.cpp -o $*.o
+ $(CXX) $(CFLAGS) -c $*.cpp -o $*.o
.SUFFIXES: .asm .o
.asm.o:
@@ -66,7 +70,7 @@
all: disasm z80_lib libs osmose
osmose: $(z80_lib) $(OSM_OBJS) $(OPT_OBJS)
- $(CC) $(CFLAGS) $(OSM_OBJS) $(Z80_LIB) $(OPT_OBJS) $(UNZIP_LIB) $(Z_LIB) -o $(OSM_EXE) $(LFLAGS)
+ $(CXX) $(CFLAGS) $(OSM_OBJS) $(Z80_LIB) $(OPT_OBJS) $(UNZIP_LIB) $(Z_LIB) -o $(OSM_EXE) $(LFLAGS)
z80_lib: $(Z80_OBJS)
ar -rv $(Z80_LIB) $(Z80_DIR)/*.o
@@ -84,8 +88,8 @@
rm -f *.o core $(OSM_EXE)
libs:
- cd $(Z_LIB_DIR) && make libz.a
- cd $(UNZIP_DIR) && make unzip.a
+ cd $(Z_LIB_DIR) && ${MAKE} libz.a
+ cd $(UNZIP_DIR) && ${MAKE} unzip.a