Skip to content

Instantly share code, notes, and snippets.

@happyincent
Last active April 10, 2017 17:59
Show Gist options
  • Save happyincent/321d1edcd96ab67ae31b88f8b9148eb4 to your computer and use it in GitHub Desktop.
Save happyincent/321d1edcd96ab67ae31b88f8b9148eb4 to your computer and use it in GitHub Desktop.
# Makefile
CC := gcc
CXX := g++
CFLAGS := -g -Wall -o3 -std=gnu99
CXXFLAGS := -g -Wall -o3 -std=c++11
LDFLAGS := -g
# LDLIBS := -pthread
TGT := xxx #(e.g. xxx.cpp in SRC)
EXT := .cpp
SRC := $(wildcard *$(EXT))
OBJ := $(SRC:$(EXT)=.o)
all: $(TGT)
$(TGT): $(OBJ)
dep:
$(CC) -M *$(EXT) > depend
clean:
@rm -f $(TGT) *.o depend
# all: $(TGT)
# $(TGT): $(OBJ)
# $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDLIBS)
# %.o : %$(EXT)
# $(CC) $(CFLAGS) -c -o $@ $<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment