view Makefile @ 64:83b8fdb45d5e

makefile: CC_FLAGS->CFLAGS
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Fri, 05 Aug 2022 23:46:44 -0400
parents dbed5f51d635
children c8b91b8c2a64
line wrap: on
line source

CFLAGS=-Wall -O2 -fstack-protector -fdata-sections -ffunction-sections
LDFLAGS=

ifeq ($(shell uname -s),Darwin)  # macOS is the odd one...
	LDFLAGS+=-Wl,-dead_strip
else
	LDFLAGS+=-Wl,--gc-sections
endif

src/%.o : src/%.c
	$(CC) -c $(CC_FLAGS) $< -o $@

msvpvf: src/main.o src/common.o
	$(CC) $(CFLAGS) -o $@ $^  $(LDFLAGS)

# GUI is windows-only, please use cross-compiler!
gui: src/gui.o src/common.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -mwindows

clean:
	rm -f src/*.o *.exe msvpvf gui