Makefile respect variables which is already set

This commit is contained in:
Andrew Clark 2024-09-15 22:53:45 +03:00
parent 0a20d69537
commit 09d84cd087

View File

@ -1,6 +1,6 @@
TARGET = ciadpi TARGET ?= ciadpi
CPPFLAGS = -D_DEFAULT_SOURCE CPPFLAGS ?= -D_DEFAULT_SOURCE
CFLAGS += -I. -std=c99 -Wall -Wno-unused -O2 CFLAGS += -I. -std=c99 -Wall -Wno-unused -O2
WIN_LDFLAGS = -lws2_32 -lmswsock WIN_LDFLAGS = -lws2_32 -lmswsock
@ -10,8 +10,8 @@ WIN_SRC = win_service.c
OBJ = $(SRC:.c=.o) OBJ = $(SRC:.c=.o)
WIN_OBJ = $(WIN_SRC:.c=.o) WIN_OBJ = $(WIN_SRC:.c=.o)
PREFIX := /usr/local PREFIX ?= /usr/local
INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin/ INSTALL_DIR ?= $(DESTDIR)$(PREFIX)/bin/
all: $(TARGET) all: $(TARGET)