Skip to content

Commit 0b3713d

Browse files
committed
organize makefile
1 parent 1d5c47f commit 0b3713d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export MACOSX_DEPLOYMENT_TARGET=$(LIBVER)
33

44
CXX=clang++
55
CPPFLAGS += -MMD -MP
6-
CXXFLAGS += --std=c++20 -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic
7-
LDFLAGS += -Llib -fvisibility=default
6+
CXXFLAGS += --std=c++20 -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic -Wno-poison-system-directories
7+
LDFLAGS += -Llib -fvisibility=default -fPIC
88
LDLIBS += -lgetargv
99

1010
.PHONY := run db clean
@@ -14,13 +14,13 @@ run: bin/main
1414
bin/main
1515

1616
lib/libgetargv++.dylib: obj/argv.o obj/argvargc.o | lib
17-
$(CXX) -dynamiclib $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) $^ -o $@
17+
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -dynamiclib $^ -o $@
1818

1919
bin/main: lib/libgetargv++.dylib obj/main.o | bin
20-
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -lgetargv++ $^ -o $@
20+
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -lgetargv++ -fPIE $^ -o $@
2121

2222
obj/%.o: src/%.cpp | obj
23-
$(CXX) $(CPPFLAGS) -c $(CXXFLAGS) $< -o $@
23+
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^ -o $@
2424

2525
bin lib obj:
2626
mkdir -p $@

0 commit comments

Comments
 (0)