From: git Date: Mon, 16 Feb 2026 08:04:03 +0000 (-0500) Subject: Makefile improvements X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=441ff60e7c3bb7499098913eaa260ae4184039a0;p=ust.git Makefile improvements --- diff --git a/Makefile b/Makefile index bb881e6..be20f26 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,20 @@ OBJ = ${SRC:.c=.o} PREFIX = /usr/local +OS != uname -s + +GNUSRC != if [ "${OS}" = "Linux" ]; then \ + printf "%s" "-D_GNU_SOURCE"; \ +fi + all: ${TARGET} -ust.c: config.h +${SRC}: config.h config.h: - cp config.def.h config.h + cp config.def.h $@ clean: - rm -f ${OBJ} rm -f *.[oa] ${TARGET} install: @@ -25,13 +30,9 @@ install: uninstall: rm -f ${PREFIX}/bin/${TARGET} - -CFLAGS = -std=c99 -Wall -pthread -O2 +CFLAGS = -std=c99 -Wall -pthread -O2 ${GNUSRC} LDFLAGS = -# comment out if not on linux -CFLAGS += -D_GNU_SOURCE - CC = cc .PHONY: all clean install uninstall