aboutsummaryrefslogtreecommitdiff
path: root/games/mvdsv/files/patch-tools_qwdtools_source_Makefile.BSD
blob: 65d6ac1fd450665920831dc64e35883d64acc316 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- tools/qwdtools/source/Makefile.BSD.orig	2020-03-18 18:17:05 UTC
+++ tools/qwdtools/source/Makefile.BSD
@@ -12,24 +12,19 @@
 #
 
 MAINDIR = ../../..
-SV_DIR = $(MAINDIR)/source
+SV_DIR = $(MAINDIR)/src
 QWDTOOLS_DIR = $(MAINDIR)/tools/qwdtools/source
 
 # To compile qwdtools as 32bit on 64bit target platform use next:
 # for gcc its like: make qwdtools FORCE32BITFLAGS=-m32
 # configure script add FORCE32BITFLAGS=-m32
 
-DO_CFLAGS		=	${CFLAGS} -Wall -pipe -pthread -funsigned-char -DUSE_PR2 -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS}
+BYTE_ORDER!=	${CC} -x c -dM -E /usr/include/machine/endian.h | sed -n 's,\#define _BYTE_ORDER \(.*\),_\1__,p'
+DO_CFLAGS		=	${CFLAGS} -Wall -pipe -funsigned-char -DSERVERONLY -D${BYTE_ORDER}Q__ ${FORCE32BITFLAGS}
 
-.if !defined(NOKQUEUE) && (${UNAME} == "FreeBSD" || ${UNAME} == "DragonFly")
-DO_CFLAGS		+=	-DKQUEUE
-.endif
-
-WITH_OPTIMIZED_CFLAGS = YES
-
 USE_ASM=-Did386
 .if defined(WITH_OPTIMIZED_CFLAGS)
-DO_CFLAGS		+=	-O2 -fno-strict-aliasing -ffast-math -funroll-loops
+DO_CFLAGS		+=	-ffast-math -funroll-loops
 . if ${MACHINE_ARCH} == "i386" && !defined(WITHOUT_X86_ASM)
 ASM=${USE_ASM}
 DO_CFLAGS		+=	${ASM}
@@ -60,7 +55,7 @@ QWDTOOLS_OBJS = \
 		${QWDTOOLS_DIR}/sync.o \
 		${QWDTOOLS_DIR}/tools.o
 
-.if ${USE_ASM} == ${ASM}
+.if defined(ASM) && ${USE_ASM} == ${ASM}
 QWDTOOLS_ASM_OBJS = \
 		${SV_DIR}/bothtoolsa.o
 .endif
@@ -70,10 +65,10 @@ QWDTOOLS_ASM_OBJS = \
 #############################################################################
 
 .c.o:
-		${CC} ${DO_CFLAGS} -c $< -o $*.o
+		${CC} ${DO_CFLAGS} -c $< -o $@
 
 .s.o:
-		${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $*.o
+		${CC} ${DO_CFLAGS} -DELF -x assembler-with-cpp -c $< -o $@
 		
 all:	qwdtools
 		${STRIP} ${STRIP_FLAGS} qwdtools