first version
This commit is contained in:
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
# ------------------------------
|
||||
# Neocities CLI Makefile (Portable)
|
||||
# ------------------------------
|
||||
|
||||
# Default compiler
|
||||
CC ?= gcc
|
||||
|
||||
# Compiler flags
|
||||
CFLAGS ?= -Wall -O2 -Iinclude
|
||||
|
||||
# Libraries
|
||||
LIBS ?= -lcurl -ljansson
|
||||
|
||||
# Source and target
|
||||
SRC = src/main.c
|
||||
BIN = neocities
|
||||
|
||||
# Detect Windows (MSYS2 / MinGW)
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = del /Q
|
||||
BIN_EXT = .exe
|
||||
else
|
||||
RM = rm -f
|
||||
BIN_EXT =
|
||||
endif
|
||||
|
||||
# Build executable
|
||||
all: $(BIN)$(BIN_EXT)
|
||||
|
||||
$(BIN)$(BIN_EXT): $(SRC)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
# Clean build files
|
||||
clean:
|
||||
$(RM) $(BIN)$(BIN_EXT)
|
||||
Reference in New Issue
Block a user