Skip to content

Instantly share code, notes, and snippets.

@shwangdev
Created June 23, 2011 05:29
Show Gist options
  • Save shwangdev/1041959 to your computer and use it in GitHub Desktop.
Save shwangdev/1041959 to your computer and use it in GitHub Desktop.
Makefile
C++ = g++
ifndef os
os = LINUX
endif
SRC= $(shell ls *.cpp)
OBJS= $(SRC:%.cpp=%.o)
DIR = $(shell pwd)
Target=test
all: $(Target)
$(Target):$(OBJS)
$(C++) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(C++) $(CCFLAGS) $< -c
clean:
rm -f *.o
rm -f $(Target)
install:
export PATH=$(DIR):$$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment