Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #system vars
- CC = gcc
- CFLAGS = -Wall
- main = main.c
- #loop elements
- DIRS := header class
- HEADERS := $(foreach dir,$(DIRS),$(wildcard $(dir)/*.h))
- CLASSES := $(foreach dir,$(DIRS),$(wildcard $(dir)/*.c))
- #compile .c files
- main: $(CLASSES) $(OBJS)
- $(CC) $(CFLAGS) $(main) $< -o $@
- @echo "Compile with success!!"
- #execute main file
- run:
- ./main
- #clear file
- clear:
- rm main
- start: main run clear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement