diff options
-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 $@ $< |