Using obj/ for .o files.
This commit is contained in:
parent
53d372675d
commit
072029db8a
8
Makefile
8
Makefile
@ -9,17 +9,17 @@ MKDIR=mkdir -p
|
||||
RM=rm -rf
|
||||
|
||||
SRC_FILES := $(wildcard src/*.c)
|
||||
OBJ_FILES := $(addprefix src/, $(notdir $(SRC_FILES:.c=.o)))
|
||||
OBJ_FILES := $(addprefix obj/, $(notdir $(SRC_FILES:.c=.o)))
|
||||
|
||||
all: $(OBJ_FILES)
|
||||
$(MKDIR) bin
|
||||
$(CXX) $(CXXFLAGS) $(LIBS) -o bin/cointoss src/*.o
|
||||
$(CXX) $(CXXFLAGS) $(LIBS) -o bin/cointoss obj/*.o
|
||||
|
||||
src/%.o: src/%.c
|
||||
obj/%.o: src/%.c
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
$(RM) src/*.o
|
||||
$(RM) obj/*.o
|
||||
|
||||
cleanall: clean
|
||||
$(RM) bin
|
||||
|
1
obj/readme.txt
Normal file
1
obj/readme.txt
Normal file
@ -0,0 +1 @@
|
||||
This is where the object output files go. This readme file is a simple hack so that git registers it (git doesn't register empty directories).
|
Loading…
Reference in New Issue
Block a user