diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-03-23 09:21:17 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-03-23 09:21:17 +0100 |
commit | bcaed97d55d753be16f31e2fee676fbc603e8999 (patch) | |
tree | 3486b41154478fd4dcfc35d20ec0c901d56b509d | |
parent | 9970586deb17a5e8623619d79245fa4c7a5d9b55 (diff) |
Makefile: Only link fltk on gui builds
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,10 +1,13 @@ CXX = g++ CXXFLAGS = -Wall -Wextra -std=gnu++11 -g -fwrapv -I$(FLTK)/include -LDFLAGS = -L$(FLTK)/lib -lfltk +LDFLAGS = TARGETS = sim gui FLTK = /usr/local/opt/fltk +# Disable automatic rules +.SUFFIXES: + .PHONY: all clean remake all: $(TARGETS) @@ -16,8 +19,11 @@ remake: clean $(MAKE) all -$(TARGETS): %: %.o $(filter-out $(addsuffix .o,$(TARGETS)),$(patsubst %.cpp,%.o,$(wildcard *.cpp))) +sim: %: %.o $(filter-out $(addsuffix .o,$(TARGETS)),$(patsubst %.cpp,%.o,$(wildcard *.cpp))) $(CXX) -o $@ $^ $(LDFLAGS) +gui: %: %.o $(filter-out $(addsuffix .o,$(TARGETS)),$(patsubst %.cpp,%.o,$(wildcard *.cpp))) + $(CXX) -o $@ $^ $(LDFLAGS) -L$(FLTK)/lib -lfltk + %.o: %.cpp $(wildcard *.h) $(CXX) $(CXXFLAGS) -c -o $@ $< |