Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FRAME_LIB = lib/LibFrame.a
- C_FILES := $(wildcard src/*.cpp)
- OBJS := $(patsubst src/%.cpp, build/%.o, $(C_FILES))
- INCDIRS = -I./include -I../include
- CC = cc
- CFLAGS = -Wall $(INCDIRS)
- LDFLAGS =
- AR = ar
- all: $(FRAME_LIB)
- $(FRAME_LIB): .depend $(OBJS)
- $(AR) rcs $(FRAME_LIB) $(OBJS)
- # $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(PROGRAM)
- depend: .depend
- .depend: cmd = gcc $(INCDIRS) -MM -MF depend $(var); cat depend >> .depend;
- .depend:
- @echo "Generating dependencies..."
- @$(foreach var, $(C_FILES), $(cmd))
- @rm -f depend
- -include .depend
- # These are the pattern matching rules. In addition to the automatic
- # variables used here, the variable $* that matches whatever % stands for
- # can be useful in special cases.
- %.o: %.c
- $(CC) $(CFLAGS) -c $< -o $@
- build/%.o: src/%.cpp
- $(CC) $(CFLAGS) -c $< -o $@
- %: %.c
- $(CC) $(CFLAGS) -o $@ $<
- clean:
- rm -f .depend build/*.o $(FRAME_LIB)
- .PHONY: clean depend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement