Skip to content

Commit

Permalink
fix FindLib makefile to make it buildable standalone
Browse files Browse the repository at this point in the history
Copy the "features" CFLAGS portion and some missing defines from the main makefile to fix the
standalone build of FindLib.

Change the definition of OBJ_DIR to match the main makefile.

FindLib may be useful as a standalone library which could be packaged separately and TraX made
dependendent on it.
  • Loading branch information
jmairboeck authored and korli committed May 17, 2024
1 parent 63cb414 commit e54957a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions FindLib/etc/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### makefile for findlib

OBJ_DIR := obj
SYS_VERS := r$(shell uname -r)
OBJ_DIR := obj.$(SYS_VERS)
DEP_DIR := depends


Expand All @@ -9,13 +10,27 @@ DEP_DIR := depends
OPTIMIZER = -O0

CC = gcc
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy

# This is needed to be able to compile on either nightlies, or beta4.
# See https://dev.haiku-os.org/ticket/11818 (fixed for good in hrev57497).
# We can simplify this once the haikuports buildmasters switch to beta5.

HAIKU_HREV_NUM = $(shell uname -v | cut -d " " -f 1 | cut -d "+" -f 1 | sed s/hrev//)
HAS_FIXED_FEATURES_H = $(shell if [ $(strip $(HAIKU_HREV_NUM)) -ge 57497 ]; then echo "YES"; else echo "NO"; fi)

ifeq ($(strip $(HAS_FIXED_FEATURES_H)), YES)
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy -D_DEFAULT_SOURCE -DSTDC_HEADERS
else
CFLAGS = $(OPTIMIZER) -Wall -Wno-multichar -Wno-ctor-dtor-privacy -D__USE_GNU -DSTDC_HEADERS
endif

LD = gcc
LDFLAGS =
SHAREDLIB_FLAGS = -nostart -Xlinker -soname=$(notdir $@)
SHAREDLIB_FLAGS = -shared -Xlinker -soname=$(notdir $@)


MAKE_DEPEND = ../../etc/MakeDepend.sh $(CFLAGS) -c $< -dep $@
MAKE_CC = $(CC) $(CFLAGS) -c $< -o $@


FINDLIB_DIR := ..
Expand Down

0 comments on commit e54957a

Please sign in to comment.