Created
January 18, 2018 22:46
-
-
Save SaitoAtsushi/d230b0ecd026427922694077a4cba626 to your computer and use it in GitHub Desktop.
ISLISP 処理系 KISS 用の makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRCS := $(wildcard *.c) | |
OBJS := $(patsubst %.c,%.o,$(SRCS)) | |
DOBJS := $(addprefix debug/,$(OBJS)) | |
POBJS := $(addprefix profile/,$(OBJS)) | |
CC = gcc | |
CFLAGS = -Wall -O3 | |
LDFLAGS = | |
LIBS = -lm -lgmp | |
UNAME = $(shell uname -a) | |
ifneq (,$(findstring MINGW, $(UNAME))) | |
EXT = .exe | |
else | |
EXT = | |
endif | |
TARGET = kiss$(EXT) | |
.PHONY: all clean test | |
all: $(TARGET) | |
debug: debug_dir debug/$(TARGET) | |
debug_dir: | |
-mkdir debug | |
profile: profile_dir profile/$(TARGET) | |
profile_dir: | |
-mkdir profile | |
$(TARGET): $(OBJS) | |
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) | |
debug/$(TARGET): $(DOBJS) | |
$(CC) $(LDFLAGS) -g -o $@ $^ $(LIBS) | |
profile/$(TARGET): $(POBJS) | |
$(CC) $(LDFLAGS) -pg -o $@ $^ $(LIBS) | |
./%.o: %.c kiss.h | |
$(CC) -c $(CFLAGS) $< -o $@ | |
debug/%.o: %.c kiss.h | |
$(CC) -c $(CFLAGS) -g $< -o $@ | |
profile/%.o: %.c kiss.h | |
$(CC) -c $(CFLAGS) -pg $< -o $@ | |
clean: | |
rm -f $(TARGET) $(OBJS) $(DOBJS) $(POBJS) newfile example.dat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment