This repository has been archived on 2023-11-15. You can view files and clone it, but cannot push or open issues or pull requests.
feuille/config.mk

45 lines
1.3 KiB
Makefile

# feuille version
VERSION = 2.1.2
# paths (customize them to fit your system)
PREFIX = /usr/local
MAN = $(PREFIX)/share/man
# includes and libs
INCS = -I/usr/include -I.
LIBS = -L/usr/lib -lc
# OpenBSD / FreeBSD (uncomment)
#MAN = $(PREFIX)/man
#INCS = -I/usr/share/include -I.
#LIBS = -L/usr/share/lib -lc
# compiler
CC = cc
# cosmopolitan libc flags
CCFLAGS = -std=c99 -nostdinc -fno-pie -fno-omit-frame-pointer \
-mno-tls-direct-seg-refs -mno-red-zone \
-DVERSION=\"$(VERSION)\" -DCOSMOPOLITAN \
-I. -include cosmopolitan/cosmopolitan.h
CLDFLAGS = -std=c99 -static -nostdlib -fno-pie -fno-omit-frame-pointer \
-mno-tls-direct-seg-refs -mno-red-zone \
-fuse-ld=bfd -Wl,-T,cosmopolitan/ape.lds -Wl,--gc-sections \
cosmopolitan/crt.o cosmopolitan/ape-no-modify-self.o cosmopolitan/cosmopolitan.a
# standard libc flags
CCFLAGS$(COSMO) = -std=c99 -DVERSION=\"$(VERSION)\" $(INCS)
CLDFLAGS$(COSMO) = $(LIBS)
# debug flags
CFLAGS = -g -Wall -Wextra -Wno-sign-compare -DDEBUG $(CCFLAGS)
LDFLAGS = -g $(CLDFLAGS)
# release flags
CFLAGS$(DEBUG) = -O3 -Wall -Wextra -Wno-sign-compare $(CCFLAGS)
LDFLAGS$(DEBUG) = -s $(CLDFLAGS)
# static build (uncomment)
#LD_FLAGS += -static