Skip to content

Commit

Permalink
Makefile reorg and site update
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Sep 20, 2024
1 parent bcfcb2f commit 7e135db
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="533368308517884254" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="533476417727484254" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ prior to invoking `make`. The following build variables can be configured:
- `CFLAGS`: Flags to pass onto the C compiler (default: `-Os -Wall -std=c99`). Note, `-Iinclude` will be added
automatically.

- `LDFLAGS`: Linker flags (default is `-lm`). Note, `-lpq -lsmax -lredisx -lxchange -lpthread -lpopt` will be added
automatically.
- `LDFLAGS`: Extra linker flags (default: _not set_). Note, `-lm -pthread -lsmax -lredisx -lxchange -lpq -lpopt` will
be added automatically.

- `BUILD_MODE`: You can set it to `debug` to enable debugging features: it will initialize the global `xDebug`
variable to `TRUE` and add `-g` to `CFLAGS`.
Expand Down
67 changes: 34 additions & 33 deletions config.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ===========================================================================
# Generic configuration options for building the RedisX library (both static
# and shared).
# Generic configuration options for building smax-postgres
#
# You can include this snipplet in your Makefile also.
# ============================================================================
Expand Down Expand Up @@ -58,37 +57,6 @@ CFLAGS ?= -Os -Wall -std=c99
# Link against math libs (for e.g. isnan())
LDFLAGS ?= -lm

# Compile and link against a specific PostgreSQL library (if defined)
ifdef PGDIR
CPPFLAGS += -I$(PGDIR)/include
LDFLAGS += -L$(PGDIR)/lib
LD_LIBRARY_PATH = $(PGDIR)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific smax library (if defined)
ifdef SMAXLIB
CPPFLAGS += -I$(SMAXLIB)/include
LDFLAGS += -L$(SMAXLIB)/lib
LD_LIBRARY_PATH = $(SMAXLIB)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific redisx library (if defined)
ifdef REDISX
CPPFLAGS += -I$(REDISX)/include
LDFLAGS += -L$(REDISX)/lib
LD_LIBRARY_PATH = $(REDISX)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific xchange library (if defined)
ifdef XCHANGE
CPPFLAGS += -I$(XCHANGE)/include
LDFLAGS += -L$(XCHANGE)/lib
LD_LIBRARY_PATH = $(XCHANGE)/lib:$(LD_LIBRARY_PATH)
endif

# Always link against the xchange lib.
LDFLAGS += -lsmax -lredisx -lxchange -lpq

# cppcheck options for 'check' target
CHECKOPTS ?= --enable=performance,warning,portability,style --language=c \
--error-exitcode=1 --std=c11 $(CHECKEXTRA)
Expand Down Expand Up @@ -116,11 +84,44 @@ ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -DDEBUG
endif

# Always link against dependencies
LDFLAGS += -lm -lsmax -lredisx -lxchange -lpq

ifeq ($(SYSTEMD),1)
DFLAGS += -DUSE_SYSTEMD=1
LDFLAGS += -lsystemd
endif

# Compile and link against a specific PostgreSQL library (if defined)
ifdef PGDIR
CPPFLAGS += -I$(PGDIR)/include
LDFLAGS += -L$(PGDIR)/lib
LD_LIBRARY_PATH = $(PGDIR)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific smax library (if defined)
ifdef SMAXLIB
CPPFLAGS += -I$(SMAXLIB)/include
LDFLAGS += -L$(SMAXLIB)/lib
LD_LIBRARY_PATH = $(SMAXLIB)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific redisx library (if defined)
ifdef REDISX
CPPFLAGS += -I$(REDISX)/include
LDFLAGS += -L$(REDISX)/lib
LD_LIBRARY_PATH = $(REDISX)/lib:$(LD_LIBRARY_PATH)
endif

# Compile and link against a specific xchange library (if defined)
ifdef XCHANGE
CPPFLAGS += -I$(XCHANGE)/include
LDFLAGS += -L$(XCHANGE)/lib
LD_LIBRARY_PATH = $(XCHANGE)/lib:$(LD_LIBRARY_PATH)
endif



# Search for files in the designated locations
vpath %.h $(INC)
vpath %.c $(SRC)
Expand Down

0 comments on commit 7e135db

Please sign in to comment.