# --------------------------------------------------------------------- # # Copyright (C) 2012 - Sergey Goldgaber # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # # --------------------------------------------------------------------- TARGET := proccpuinfo SOURCE := $(TARGET).scm # Paths CSC := csc CSI := csi TEST_DIR := tests TEST_SCRIPT := run.scm # Configure and uncomment the following lines if you get tired of # specifying CFLAGS and LDFLAGS on the command line: # #CFLAGS=-I/usr/local/libproccpuinfo/include #LDFLAGS=-L/usr/local/libproccpuinfo/lib # What libraries to include as part of csc's options LIBS := -l$(TARGET) # Options CSC_OPTIONS_1 := -d1 # debug level CSC_OPTIONS_1 += -O2 # optimization level CSC_OPTIONS_1 += -k # keep intermediate files CSC_OPTIONS_1 += -s # generate dynamically loadable shared object file CSC_OPTIONS_1 += -J # emit import-libraries for all defined modules CSC_OPTIONS_1 += $(CFLAGS) CSC_OPTIONS_1 += $(LDFLAGS) CSC_OPTIONS_1 += $(LIBS) CSC_OPTIONS_2 := -d0 # debug level CSC_OPTIONS_2 += -O2 # Optimization level CSC_OPTIONS_2 += -k # keep intermediate files CSC_OPTIONS_2 += -s # generate dynamically loadable shared object file CSC_OPTIONS_2 += -J # emit import-libraries for all defined modules CSC_OPTIONS_2 += $(CFLAGS) CSC_OPTIONS_2 += $(LDFLAGS) CSC_OPTIONS_2 += $(LIBS) CSC_OPTIONS_3 := -c # stop after compilation to object files CSC_OPTIONS_3 += -d1 # debug level CSC_OPTIONS_3 += -O2 # Optimization level CSC_OPTIONS_3 += $(CFLAGS) CSI_OPTIONS += -s # use interpreter for shell scripts .PHONY : all .PHONY : clean .PHONY : test all: $(TARGET).o $(TARGET).so $(TARGET).import.so $(TARGET).so: $(SOURCE) $(CSC) $(CSC_OPTIONS_1) $(SOURCE) -j $(TARGET) $(TARGET).import.so: $(TARGET).so $(TARGET).import.scm $(CSC) $(CSC_OPTIONS_2) $(TARGET).import.scm $(TARGET).o: $(SOURCE) $(CSC) $(CSC_OPTIONS_3) $(SOURCE) -unit $(TARGET) -j $(TARGET) test: $(TEST_DIR)/$(TEST_SCRIPT) ( cd $(TEST_DIR) ; $(CSI) $(CSI_OPTIONS) $(TEST_SCRIPT) ) clean: rm -f $(TARGET).c rm -f $(TARGET).import.scm rm -f $(TARGET).o rm -f $(TARGET).so rm -f $(TARGET).import.c rm -f $(TARGET).import.o rm -f $(TARGET).import.so # vim: ft=make