From 7a123fba97b00ff7a62595e750341a33bca192ea Mon Sep 17 00:00:00 2001 From: night0721 Date: Mon, 4 Nov 2024 23:38:50 +0000 Subject: [PATCH] Update CFLAGS --- 1 | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 2 +- lcc.c | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 0000000..37a349e --- /dev/null +++ b/1 @@ -0,0 +1,36 @@ +.POSIX: +.SUFFIXES: + +VERSION = 1.0 +TARGET = lcc +PREFIX ?= /usr/local +BINDIR = $(PREFIX)/bin + +CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall + +SRC = lcc.c + +$(TARGET): $(SRC) + $(CC) $(SRC) -o $@ $(CFLAGS) + +dist: + mkdir -p $(TARGET)-$(VERSION) + cp -R README.md $(TARGET) $(TARGET)-$(VERSION) + tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION) + gzip $(TARGET)-$(VERSION).tar + rm -rf $(TARGET)-$(VERSION) + +install: $(TARGET) + mkdir -p $(DESTDIR)$(BINDIR) + cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) + chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET) + +uninstall: + rm $(DESTDIR)$(BINDIR)/$(TARGET) + +clean: + rm $(TARGET) + +all: $(TARGET) + +.PHONY: all dist install uninstall clean diff --git a/Makefile b/Makefile index 65d40a3..37a349e 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ TARGET = lcc PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin -CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall +CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall SRC = lcc.c diff --git a/lcc.c b/lcc.c index 49f0356..6d1a60c 100644 --- a/lcc.c +++ b/lcc.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include "lcc.h"